The thing that would've saved me the most time and frustration in the long run for all mobile development (well, all dev period, but mobile especially as they tend to be moving targets): Ignore the framework. Write your app how you want to write it, then attach it to the framework as needed. Don't restrict yourself to what the framework supplies or how it thinks about things. It'll dramatically decrease craziness in…
Ask HN: What do you regret you didn't know when programming for iOS or Android?
161–166 of 166 posts
Re: Ask HN: What do you regret you didn't know when programming for iOS or Android?
#162Earlier quoted context omitted.
https://stackoverflow.blog/2018/09/05/developer-salaries-in-... Well, ok, I guess it's not that grim. Still, it's a pretty crappy job.
If you had your choice, would you do something else? Like being in finance or becoming a dentist?
Re: Ask HN: What do you regret you didn't know when programming for iOS or Android?
#163It depends somewhat on why you ask. A lot of people are recommending using cross platform solutions. As a hobby or learning exercise, go for it! As someone who has a career across many projects working full time as a native iOS and Android dev, I can say these solutions are generally avoided. They are good for prototypes you don’t plan to maintain long term, I’ll give them that. I know it’s cheesy but my only regret…
As a front end dev I’ve been thinking about it for so long but honestly I don’t know what I should build or study first.
As far as learning, I think this Stanford course is the best way (though not for those who aren’t absolute beginners to programming). I notice it hasn’t been updated lately but it should be current enough https://www.youtube.com/watch?v=TZL5AmwuwlA
Re: Ask HN: What do you regret you didn't know when programming for iOS or Android?
#164The thing that would've saved me the most time and frustration in the long run for all mobile development (well, all dev period, but mobile especially as they tend to be moving targets): Ignore the framework. Write your app how you want to write it, then attach it to the framework as needed. Don't restrict yourself to what the framework supplies or how it thinks about things. It'll dramatically decrease craziness in…
With React hooks or android component life cycle its hard separate the framework and logic. How do you do it ? Any recommended books or other resources ?
Android lifecycles are probably the main target of my comment tbh. They're abysmally complex and make any kind of state management incredibly error-prone.
As a tradeoff for that complexity and losing a lot of control, if (and only if) you go all-in on them, you get decent state reviving after process death, which can do really slick things like "app crashed" -> it just appears to go back one screen.
Instead, you can write your app as e.g. an in-memory singleton somewhere. You can even do that in a different thread if you want, leaving your UI impossibly smooth (at increased risk of "tap x" -> "nothing happens"). Design your own lifecycle that makes sense for your app (which probably looks very little like the Android lifecycle, especially when you throw in fragments...) and trigger/wait on the external world of the Android framework as needed. Odds are pretty good that you'll take multiple things from Android and combine them into one in yours, and potentially vise versa (e.g. multiple actions from your app become view updates in a single activity, rather than multiple activities. or do everything in one activity, it's often far better performance anyway, and much easier to control in fine-grained ways. importantly, your core logic doesn't care, unlike if you put that logic in the activities).
Re: Ask HN: What do you regret you didn't know when programming for iOS or Android?
#165I wish I had realised that Android app development ecosystem (the dev tools, API, documentation, gradle, dependency management etc) is a shit show and is going to remain a shit show and I should have moved to backend early in my career. Now companies are very reluctant about it.
Re: Ask HN: What do you regret you didn't know when programming for iOS or Android?
#166Don’t underestimate the value of build tools. Just because you know Xcode and Swift or Android Studio and Kotlin (or their antecedent languages) are you done. Finally having a senior dev who knows what he’s talking about has done more for me in the past two years than the previous 8 of reading blog posts and hacking. He’s shown me the real value of build scripts. Today even my personal iOS projects are dependent on a…
Can you explain more? I'd like to learn more about this.