23

We are taking over an Android application source code from an external company to continue development in-house...
I present to you floateger:
(one of many crimes the previous developer has commited)

Comments
  • 2
  • 3
  • 2
    @irene what in that looks even a bit like Javascript?
  • 5
    @irene @Codex404 nvm, I see it now the comments and the '=' is the same in Javascript🙃
  • 2
    @irene first of in javascript you dont have "val", you dont have typed variables (" : Float")
  • 3
    @Codex404 It looks a lot like typescript.
  • 1
    @Emphiliis i wouldnt call it a lot but yes it does have more similarities to typescript. But I think even more like Go (I dont know that so im not 100%sure)
  • 0
    @Codex404 nah, more similar to TypeScript
  • 1
    @irene It is Kotlin... but we write all the new features in Java because this is the only time I've seen him use types... and the code is spaghetti and there are functions like:
    fun getUserGender() : String {
    val result = getUser().gender
    return result
    }

    fun getUser() : User {
    val result = readUser().user
    return result
    }

    fun readUser() : UserModel {
    val result = Realm.getDefaultInstance().where(User::java.class).findFirst()
    return result
    }

    ...and so on
  • 2
    @irene yeah... that's what you get when a product manager tries to make an Android app
  • 2
    @vlatkozelka Because the non-profit advertised for a Java developer when I came for the interview and there was not a single word about Kotlin during the interview... and also because the unpaid(beneficial work... we are working on an app to help very sick children) senior developer/project manager who is helping me and giving me tasks also does not know Kotlin and is working a part time job in a big company that runs a search engine and is doing big data in Java for them.

    Edit: Also, I hate Kotlin... val is a constant, var is a variable, there is no ternary operator, the code is pretty much unreadable with big chunks of it being generated at build time, it is never clear what type a variable/constant is and override is a freaking keyword
  • 2
    @vlatkozelka In the end, considering a language “readable” is very opinionated. e.g. i think Python is very unreadable but many, many people disagree with me. Same with Go, i think it’s very readable like many people do but some colleagues strongly disagree with me on that. In the end, i think it’s personal preference :)
  • 1
    @jelleken I agree with you on the "python is unreadable" part
  • 0
    @vlatkozelka I was not talking about immutability, I was talking about it being named "val" when there is also "var".

    Ternary operator is perfectly readable, you can read it as: is something true ? I guess so : I don't think so
    It works perfectly fine if you maintain the standard line length.

    Yes, I love the verbosity of Java, you can just look at something and immediately tell exactly what type it is or what type it returns, wether you need to make an instance of the object/class first and from where you can call it.
    For me reading code written in Java is like reading a book, I am not able to do that with any other language... despite working with other languages far more often than with Java

    And yes, having override as a keyword really bugs me. It is an annotation and it should stay that way
  • 0
    @vlatkozelka oh, and about the generated code, half of the code of the app is generated from annotations and JSON... like wtf... people can't even be bothered to write a few lines of code nowadays
Add Comment