20

It's 2017. This person used an AsyncTask to get results from an API. During a hiring task. He has over 2.5 years of experience.

Comments
  • 5
    What are the other possibilities ? #noob
  • 5
    I think this is just normal, because '2.5 years of experience' literally doesn't say anything about how recent and how frequent he uses Java for API request.

    Maybe we need to check if his knowledge is up to date enough during the interview?
  • 8
    @Orionss Clearly he should have curled it into a file and scanned that file in, that's what a real programmer would have done
  • 11
    I see no problems with that except that its unneccessarily overfactored
  • 3
    @RazorSh4rk Can't disagree
  • 2
    @-Neo I don't understand why it is incompatible with the AsyncTask ?
  • 5
    Yes there are better ways with reactive programming and such, but that's not a wrong way of doing things.
    Especially if you work with an older app where introducing reactive would mean countless hours of refactoring, to not create inconsistent structure, which no manager would allow.

    So I really don't see your point.
  • 1
    I wrote similar code recently for an Android position and was offered the job so... I had 0 professional Android experience though.
  • 2
    Agreeing with @sylflo on this one. If it was intended as a task I would say this guy passed with fying colors. He showed that the knows the underlying logic and structure of doing network communication in Java and that he is not some copy/paste dev
  • 0
    He made his work. I think that a few code reviews later he will be a really good dev. Are you looking for senior or what? :-)
  • 2
    I'm just an Android Development student, but to be honest his code, at least to me, looks pretty good. Remember that 2.5 years of experience coding isn't that much, and the man probably just didn't know of a better way to do this, this definitely doesn't make him a bad programmer or revoke him of potentially becoming a great one.
  • 1
    Not a Java developer here. So not sure what is wrong with AsyncTask. But can't say I am not curious. If someone can explain maybe that will help me and others.

    Thanks 🤔
  • 3
    I do not see your point. Sure he could have used volley or reactive programming but his knowledge of Java networking seems pretty solid.
  • 6
    @Synster You can't perform network operations on the main thread in android, so the old fashioned approach was to create asynctasks which are basically android background threads (grossly oversimplifying here) and return the server response to the main thread.

    Nowadays there are libraries like volley or RxAndroid which provide a nicer/cleaner/simpler way of doing that stuff.
    But again using a library like that isn't possible/affordable in some cases for the short term benefit of releasing features which most managers like more than long term benefits such as clean architecture and a maintainable codebase.
  • 0
  • 0
    @JaredDunn He has worked on Android for 2.5 years. I do think that using an asynctask to call an API when you're applying for a role at a startup isn't a good call due to the lifecycle issues
  • 0
    @SmirkingBandit you don't need reactive programming for this, a simple retrofit call would suffice. Also, it would be a lot of overhead while refactoring code, but here you're creating a new project
  • 2
    @sylflo Due to all the comments here, I've decided to call the guy for the next round and actually discuss this. Let's hope for the best 😁
  • 0
    @sylflo that's the reason for calling him now 😂
Add Comment