Hi HN,<p>The quick version of my question is: What are the pros and cons of creating a web application in Kotlin and if you had your choice of languages would you use Kotlin for that purpose?<p>The long version:
I just started a side project which will be your average web application. Users, authenticaiton, authorization, CRUD actions, your usual things. One of my goals is to learn a new language.<p>I've used statically typed languages for the backend for the majority of my dev career (C#, C++, just a little F#). I tried out Python and while I really like it for small projects, parsing data files, and practicing data structures and algorithms I really miss being able to lean on static typing when refactoring. I also miss the strong IDE integration I get with that category of languages.<p>I checked out mypy with Python and it's really cool but unless I configured it wrong it doesn't apply its type checking across files well.<p>All of this led to me to look at Java and then Kotlin. I love how you only need to type one side of your declarations like I'm using C#'s var. The idea of data classes is fantastic as well.<p>Because Kotlin is on the JVM and can interop with Java I'm hoping I can leverage those libraries and frameworks when needed. For some commentary on the tools, IntelliJ is a great IDE and I'm not sure how I feel about gradle yet.<p>With all that said, have any of you used Kotlin to build a webapp? What did you like about it, what didn't you like? What other statically typed language would you use?
> tried out Python and while I really like it for small projects, parsing data files, and practicing data structures and algorithms I really miss being able to lean on static typing when refactoring. I also miss the strong IDE integration I get with that category of languages.<p>PyCharm has excellent integration with the language. It can give you expected return types and check types of parameters if you sue type hints or if you give functions and methods doc strings. I've used Java along with IntelliJ and I would say the difference is pretty minimal. There is a metric ton more boiler plate to write in Java so it's more needed. If you write Python like you write Java you're going to have a bad time no matter what.<p>I would suggest Go. You get static typing,less verbosity, and a much easier to use concurrency model. Depends on what you are making though. ORM's are not really all that popular in the Go community so if you'll be needing one you may want to look for something else. That being said, writing SQL isn't the end of the world and there are a lot of upsides to using it.
Our backend is currently 50% Kotlin with hopefully 100% when we do a full migration. I think you're already aware of the benefits such as data classes which remove the cruft of normal POJOs. What Kotlin doesn't gift you is a magically better architecture. There's still verbosity in querying a db, serializing JSON, mapping SQL results. Those things by themselves are of course not difficult but add in different layers and abstractions and suddenly the language itself doesn't help that much when your overall flow is just as complicated.<p>I'm not sure what is necessarily better right now - I am pretty happy with Kotlin (using Dropwizard) and the type safety that comes with it.
If you want to learn a new language, then pick a project that has a known (to you) scope, like porting an existing application you wrote.<p>If you want to complete a new project, stick to what you know.<p>Risk multiples.<p>If you want to pick a backend language, then pick one of: Go/Ruby (On Rails)/Python/node.js/PHP. If you don't know which, then pick one of them randomly.<p>Those languages were used to ship tens of thousand web applications.<p>Anything outside of that is an adventure. Remember: risk multiplies.<p>Kotlin is a fine language and you'll probably be fine but I would still pick Go/Ruby/Python/node.js/PHP.
I love Kotlin, but JavaScript/node/typescript already gives a lot of the back end hacker buzz.<p>Kotlin works great for large projects, because of the way components go together. It would be nice to see it in a full web framework.
I've done back ends in TypeScript/Node. The TypeScript part is great; the rest is still Node and has awful, frustrating downsides. Package management remains a disaster.<p>I haven't tried them yet, but Rust and Kotlin are next on my list. I really can't stand working without static typing anymore.
Is Kotlin somewhat stable, or changing fast like I think I've read Rust is? Sorry if my impression on Rust is wrong or out of date, I think I read at least somewhat recently that it is still changing fast.