TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Using Kotlin for web application back end

4 pointsby backslash_16about 7 years ago
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&#x27;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&#x27;s really cool but unless I configured it wrong it doesn&#x27;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&#x27;m using C#&#x27;s var. The idea of data classes is fantastic as well.<p>Because Kotlin is on the JVM and can interop with Java I&#x27;m hoping I can leverage those libraries and frameworks when needed. For some commentary on the tools, IntelliJ is a great IDE and I&#x27;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&#x27;t you like? What other statically typed language would you use?

7 comments

imauldabout 7 years ago
&gt; 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&#x27;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&#x27;s more needed. If you write Python like you write Java you&#x27;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&#x27;s are not really all that popular in the Go community so if you&#x27;ll be needing one you may want to look for something else. That being said, writing SQL isn&#x27;t the end of the world and there are a lot of upsides to using it.
评论 #16530621 未加载
testbabout 7 years ago
Our backend is currently 50% Kotlin with hopefully 100% when we do a full migration. I think you&#x27;re already aware of the benefits such as data classes which remove the cruft of normal POJOs. What Kotlin doesn&#x27;t gift you is a magically better architecture. There&#x27;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&#x27;t help that much when your overall flow is just as complicated.<p>I&#x27;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.
评论 #16518999 未加载
kjksfabout 7 years ago
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&#x2F;Ruby (On Rails)&#x2F;Python&#x2F;node.js&#x2F;PHP. If you don&#x27;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&#x27;ll probably be fine but I would still pick Go&#x2F;Ruby&#x2F;Python&#x2F;node.js&#x2F;PHP.
评论 #16518434 未加载
muzaniabout 7 years ago
I love Kotlin, but JavaScript&#x2F;node&#x2F;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.
romanovcodeabout 7 years ago
If you are proficient in C# I don&#x27;t really see the point in going into Kotlin at all given that you can use .NET Core.
smt88about 7 years ago
I&#x27;ve done back ends in TypeScript&#x2F;Node. The TypeScript part is great; the rest is still Node and has awful, frustrating downsides. Package management remains a disaster.<p>I haven&#x27;t tried them yet, but Rust and Kotlin are next on my list. I really can&#x27;t stand working without static typing anymore.
评论 #16518331 未加载
评论 #16518144 未加载
vram22about 7 years ago
Is Kotlin somewhat stable, or changing fast like I think I&#x27;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.