https://kotlinlang.org logo
Title
j

jmfayard

10/19/2019, 8:17 AM
Kotlin is a great fit for badckend development. But the experience of searching for a job in this area? Not so nice. I put very prominently on my profiles that I do Kotlin and backend programming and that I explicitely do not want to do Android, but that’s still the vast majority of offers I’m getting. Any ideas on how do improve that experience?
👍 4
g

Gopal S Akshintala

10/19/2019, 8:25 AM
Kotlin developer is becoming a synonym to Android developer 😔 Community needs more push towards Kotlin on server side, there are hardly any good books or resources available on Kotlin Server side
j

jmfayard

10/19/2019, 8:38 AM
I think we need more marketing above all
💯 2
1
t

tipsy

10/19/2019, 8:38 AM
apply for java positions. chances are they are already using kotlin, if not they'll probably consider it
👍 2
j

jmfayard

10/19/2019, 8:39 AM
that’s one way to do it. But frankly I am much more productive in a pure Kotlin codebase, so having a way to filter out the java positions would be nice.
d

Dennis Schröder

10/19/2019, 8:53 AM
Stackoverflow jobs does a pretty good job in filtering what you like and disslike ...
👍 1
j

jmfayard

10/19/2019, 8:56 AM
I think I will write an article about this. I started another thread here https://kotlinlang.slack.com/archives/C0922A726/p1571475269385200
j

jaguililla

10/19/2019, 10:59 AM
And don't forget to join #hiring 😉
👍 1
p

poohbar

10/20/2019, 6:48 PM
I am a backend dev, working in the JVM/Spring stack and we are currently moving from Kotlin back to Java. We also stopped asking for Kotlin during hiring for this reason. And why? The tooling. IntelliJ just works much faster and better with big Java projects than big Kotlin projects, let alone big Kotlin+Java mixed projects which perform the worst. It has reached a point where we just can't afford using Kotlin anymore and it is jeopardizing our entire development. Introducing a compiler error into a Kotlin file slows the whole IDE to a crawl and typing/selecting/fixing the issues freezes the editor for >10 seconds on every action. JetBrains refuses to acknowledge this as a problem and fix it. There is a whole bunch of issues on YouTrack and nobody is working on resolving them. I can't recommend starting a production-level enterprise backend project in Kotlin at this point.
m

Mike

10/20/2019, 6:56 PM
Writing micro-services works just fine as they tend to be smaller, but this is a good caveat. If you have a monolith, tread lightly/slowly.
t

todd.ginsberg

10/20/2019, 7:00 PM
@poohbar From what I've heard, the main focus of IntelliJ 2019.3 is performance increases. Perhaps try 2019.3 EAP and see if that helps? https://blog.jetbrains.com/idea/2019/10/preview-the-performance-improvements-in-intellij-idea-2019-3/
💯 2
p

poohbar

10/20/2019, 7:26 PM
95% of shops don't actually need microservices. Unless you are Netflix or Amazon you will be fine with a monolith. And if Java monolith worked fine, the same Kotlin should work just as good or even better in the same IDE. Which is definitely not the case from my experience. @todd.ginsberg Well I am definitely going to try 2019.3 but none of the performance issues I reported are being fixed in 2019.3.
lol.. faster startup.. I couldn't care less about STARTUP time, why even waste devtime on that.
j

Jonathan Mew

10/21/2019, 7:32 AM
sounds like you have much more IntelliJ pain than we do (most of our logic is frontend I guess, so the Kotlin backend is not so big) but I definitely find the slow startup painful
m

Mike

10/21/2019, 10:30 AM
I'm surprised you find the startup much of an issue in comparison to overall usage. Are you starting and stopping IntelliJ a lot during the day? I find I start it, and leave it running, so the startup isn't that big a deal. Plus I remind myself how much it does once it's up. Not going to complain about a bit faster startup, but personally agree with poohbar that it's a low priority.
j

Jonathan Mew

10/21/2019, 10:31 AM
No, I avoid it most of the time. I tend to restart it occasionally to clear caches, in which case the indexing takes several minutes
I would guess that I'm not experiencing some of the other available pain points from the sound of it
m

Mike

10/21/2019, 10:33 AM
Yes, indexing is slow, but of course that should be expected, as it is indexing 'the world' on a cache reset. Why do you reset the cache? I only do that if I'm having a weird issue, and that happens quite rarely.
Kotlin + Java is known to be slower than 100% Java or 100% Kotlin. Makes sense as the compiler has to do more work for interop between Java and Kotlin. I don't fully understand the inner workings, but it sort of has to compile Java and Kotlin to then compile each with references to the other. The more files, the slower it gets. I suspect only so much optimization can be performed. Although not practical, I'd love to see how poohbar's project performed if it was 100% Kotlin to see if this is a general issue for large Kotlin only projects.
j

Jonathan Mew

10/21/2019, 10:37 AM
ah - we are pure kotlin aside from some imports, that might explain it?
and yes, only when I'm having a weird issue
m

Mike

10/21/2019, 10:42 AM
Likely explains it as imports don't matter. The library is already in byte-code, so the Kotlin compiler doesn't have to interact/wait for the Java compiler before it can do its thing. Also I get the impression that poohbar's project is 'huge'. Older backend monolith's tend to have many Ks of lines with business logic, interfaces for abstractions, tests etc.
👍 1
p

poohbar

10/21/2019, 3:01 PM
I do believe our project would perform better if it was 100% Kotlin. However, that was never the goal. It's pretty big and we never wanted to rewrite the whole thing. Which is a use case I thought JetBrains was aiming to support. I was wrong though and now I pay the price. Reminds me of when I trusted Google that they would make the upgrade path from angular.js to Angular 2 smooth. Was nothing but. Pretty much had to do a full rewrite, months of work.
Also I don't care about IntelliJ startup because I start it like once a month. Even if it took 5 minutes I wouldn't care.
l

Luis Munoz

10/21/2019, 3:48 PM
@poobar just curious what are your computer specs? Personally I cannot stand any lag, I have a computer that costs 4k.
I'm always surprised how many work on laptops even though they are twice as slow what you can get in a desktop
m

Mike

10/21/2019, 5:02 PM
@poohbar Don't worry, I wasn't suggesting that you should, or could, rewrite the whole thing. More intellectual curiousity to see if the project would still be too large for just the Kotlin compiler. And yes, I believe the intent is to be usable with mixed projects, but obviously a mixed project will never perform as well as a single language one will. BUT I agree that it should be usable, and your scenario doesn't sound usable at all. Not even close. Reminds me of my experience with the Gradle Kotlin DSL in early forms. There were issues with Kotlin only projects and massive slowdowns in the IDE. I haven't seen those for a 100% Kotlin project in a long time, but I have negligible experience with a mixed code base. I'm curious. How many lines are we talking for your project? For the Angular scenario, personally, I think it was a mistake for Google to even hint that Angular 2 was an upgrade. It was such a re-write of fundamental approaches, that it was effectively a new framework. As you say, upgrading wasn't realistic at all.
p

poohbar

10/21/2019, 5:13 PM
@Luis Munoz It's a 2015 Mac Pro (2.2 GHz i7, 16 GB RAM). It's not the fastest machine but I can easily compare the IDE performance to other projects that are Java-only and are perfectly usable. I don't think an upgrade to a 4k desktop would bring me 100x the speed of the IDE. It would be probably much less than that. @Mike The project is not really that massive. It's 50,000 lines of Java and 20,000 lines of Kotlin. We currently use Kotlin for all tests and for all data classes. I thought it was a good idea originally. I honestly have not thought, in my naivete, that "the project will never perform as well as a single language one will". I had no idea. The thing is, I don't really believe it's just "slow". Freezing for 20 seconds completely while blocking the UI on any compiler error I attempt to fix sounds more like a bug than just non-performance. The project also uses Maven instead of Gradle and I feel like Maven is getting much less attention from JetBrains nowadays.
f

fred.deschenes

10/21/2019, 6:40 PM
@poohbar: I can't remember the last IntelliJ release that didn't have issues with Gradle projects either... If there's one thing I have noticed with using Jetbrain's products for a couple of years it's that they're great at adding new stuff (ie: changing the %$!"/ icons for every release), but issues can stay open for years without any dev attention. I've also seen the slowdowns you're talking about, my current project is about 5000 lines of Kotlin (and some Java, probably like 5 classes that are used with an annotation processor), and I've had complete freezes happening when modifying classes with a lot of type inference.
p

poohbar

10/21/2019, 6:56 PM
@fred.deschenes Exactly! And I don't really understand it from their perspective. They pretty much have no competition feature-wise in JVM IDEs. Couldn't they just slow down and focus on bug fixes and performance updates? Honestly, I would be content if they have not released a single new feature for a year.
👍 2
c

corneil

10/21/2019, 7:53 PM
They have actually announced that 2019.3 was going to focus on performance and quality. So let's hope for a step forward.
m

Mike

10/21/2019, 10:51 PM
@poohbar You're right that multi-language compiler causing slowdowns isn't intuitive. I've thought back, and I first ran into it when I was hearing about Groovy. Saw a presentation, and the presenter discussed what was required in order for Groovy and Java to interop. One of those 'of course' things once it's explained, but not thought of beforehand. And the Kotlin compiler will always be slower than the Java one, but it should just be slower. I agree that what you're experiencing is not slowness, but unacceptable defects in process/ I am also surprised that it's not being taken more seriously as 70K lines isn't all that large a project. Jetbrains has been giving Maven support some love lately, but I also feel it's secondary to Gradle. As I primarily use Gradle, I don't notice.
t

tddmonkey

10/22/2019, 7:56 AM
@fred.deschenes @poohbar your experiences aren’t matching mine (thankfully for me). I’m not experiencing any of the problems you do and we’ve got 77K Java, 71K Kotlin and 32K Groovy. I’m running on a MBP too, so not a super-fast machine
p

poohbar

10/22/2019, 12:14 PM
@tddmonkey Maven or Gradle? How many modules?
t

tddmonkey

10/22/2019, 12:23 PM
Gradle, 60 modules
I do use the gradle
idea
plugin to generate the IDEA project and don’t like Gradle in IDEA
m

Mike

10/22/2019, 12:33 PM
Tangent: what don't you like about Gradle in idea? It wasn't great a couple years ago, but seems to work very well right now. Lots of love from both Gradle and Jetbrains here as gradle has put a pot of effort into making tooling integrations easier,faster,better.
t

tddmonkey

10/22/2019, 12:39 PM
I struggle to see what it gives me, but I’ve known it cause hassle for plenty of people
p

poohbar

10/22/2019, 12:45 PM
Yeah, I think the unique combination of Maven+Java+Kotlin is what trips IntelliJ up. Because most people use Gradle. I can't use Gradle because I hate it, so that's that.
t

tipsy

10/22/2019, 2:47 PM
Yeah, I think the unique combination of Maven+Java+Kotlin is what trips IntelliJ up
this is what i'm using too, and it's very slow even on a small project (10-20k lines)
m

Mike

10/22/2019, 2:58 PM
@tddmonkey It gives you consistency between IDE and CLI nowadays as IntelliJ is able to delegate most things to Gradle directly. Also don't have to remember to update the IntelliJ project externally every time the build.gradle changes. IntelliJ will either do it automatically ( I don't recommend that), or warn you that it has detected changes, and allow you to update/re-import. But YMMV. @poohbar Well, if you're 'stuck' using Maven (I slightly prefer Gradle, but like Maven too), then I think you're also 'stuck' giving up on Kotlin. I don't see Maven support ever getting the attention it would need to sort this out (assuming that's fundamentally the difference). But of course I don't represent JetBrains in any way so this is nothing more than my opinion. Fortunately for you, the Java language is improving. It will never be Kotlin, but it is getting better in some key areas.
p

poohbar

10/22/2019, 3:01 PM
@Mike That's really sad to hear. I think Gradle is a huge step back and don't understand it's popularity. And to be honest, I don't actually think it's that popular in real enterprise projects. Maven is rigid and solid. Gradle is a bunch of thrown together scripts that are impossible to decipher. Groovy is also a bad choice for a build system and Kotlin build files have performance issues.
t

tddmonkey

10/22/2019, 3:02 PM
“real enterprise projects”?
For me at least, the move away from Maven was in part because of its rigidity.
m

Mike

10/22/2019, 3:04 PM
As I say, opinion only, but that's my interpreation. I'm at a FI, and we use Gradle almost exclusively. But I don't think either of us needs to get into a discussion about Gradle. I agree on your comment on Maven, and disagree on Gradle. Enough said I think as it's not the point here.
c

corneil

10/22/2019, 3:05 PM
I have a customer that tried to move to Maven with a project consisting of over 300 modules, about 120 were ear/war/corba modules and the rest libraries. Eventually we moved to Gradle and now they are able to build consistently and they have partial local builds with huge improvements in build time. There are more than 20 developers working on the codebase and the original projects started in 2001.
1
m

Mike

10/22/2019, 3:08 PM
My opinion. Maven is perfectly fine for most projects. Gradle was created for exactly what you just described. Complicated, custom projects. But it does handle most projects just fine with conventions. It's just because it's so flexible, people will inevitably abuse it, creating spaghetti builds like the old ant days. The other concern with Gradle is the recommended practice has changed a few times over the years, and unless you know that, you're just as likely to be using an older, less elegant approach to achieve things. Gradle is meant to be declarative, but people still tend to use it imperatively. Defining everything that needs to be done explicitly as scripts/tasks rather than using the declarative nature of Gradle. It's a big mind shift from Maven.
And now I broke my 'no need to discuss further'... sorry
p

poohbar

10/22/2019, 3:12 PM
Yes, I disagree with your points on Gradle/Maven but I do agree that this not what the thread is about. I think we can all feel a little sympathy for the poor souls who use the Maven+Java+Kotlin combination because at least for me it was impossible to tell that that combination is somehow going to become unusable in medium sized project. JetBrains lack of response on this is deplorable. It would be better if they explicitly stated they it's not supported rather than this.
m

Mike

10/22/2019, 7:37 PM
We can agree on that. It shouldn't matter if you're using Gradle or Maven (or Ant, or Sbt or Bazel), as the build tool is secondary to Java/Kotlin. This is disappointing, but very valuable, information to have.
@poohbar Just had a thought. @tddmonkey said his large project works fine. But they're using the Gradle IDEA plugin to generate a project, and NOT relying on build tool integration. Is there a similar option for Maven? Someway for you to generate an IDEA project for your code so that you aren't using the IntelliJ/Maven integration? As that sounds like it is the source of the issue. It would be interesting to see if Colin's experience changed if he DID use Intellij"s import of Gradle, and therefore the IntelliJ to build tooling support and see if he experiences similar issues to you.
p

poohbar

10/22/2019, 8:43 PM
I don't understand how you could "generate a project" externally and then use it without the build tool integration. How would IntelliJ know how to compile the project? Would it basically work like an IntelliJ project without any build tool? So I would manually add the dependencies in Project Structure? It's been a while since I last did that.
t

tddmonkey

10/23/2019, 8:40 AM
@poohbar no - it generates everything that is required for the project to be built and run. It’s not that much different from Gradle/Maven integration, it just happens once, outside of IDEA, instead of being controlled from within. @Mike I’ll check if anyone on my team does an import
Have done a poll - everyone has moved to using the CLI to generate the project as they’ve found that to be more stable
c

corneil

10/23/2019, 8:45 AM
In earlier days the gradle 'idea' plugin would generate all the artifacts when you ran
./gradlew idea
and same with the 'eclipse', Now the IDE has simplified the process. If they can just wait until I save the gradle or pom file before trying to update the project it would be awesome.
p

poohbar

10/23/2019, 11:31 AM
@tddmonkey So how exactly do you do that in case of Maven? Are you talking about using "mvnw"? How do I turn off Maven integration in the project?
t

tddmonkey

10/23/2019, 11:34 AM
I have no idea, I don’t use Maven
p

poohbar

10/23/2019, 12:26 PM
Right.
m

Mike

10/23/2019, 12:41 PM
@corneil Turn off auto-import. Intellij then won't start importing until you ask it to. And it will pop up a dialog to let you know it detected a change with an 'ignore' and an 'import' button. If I'm making changes, the dialog pops up, and I just leave it there until I'm ready to re-import. @tddmonkey I use Intellij's import exclusively. My projects are simple, single module projects, so don't know if that's the issue, or you switched a while ago, and have never gone back, or there are still issues that I just haven't experienced, or heard about. Most people I work with use import. But whatever's working for you is what makes sense as there's no 'one solution fits all' in this industry.
c

corneil

10/23/2019, 2:54 PM
In my experience Maven is fine for single module projects. Anything beyond that and I pull in Gradle.
b

bjonnh

10/23/2019, 8:47 PM
2019.3 promises way more than startup times. They also corrected quite a few things in Java type inference: "We’ve invested a lot of effort into optimizing Java type inference, which helped us fix the various editor hangs. Also, Java type inference for long method call chains now works much faster."
"Up to this moment, we’ve received about 6,600 UI freeze reports and have fixed issues that were causing UI freezes affecting over 1600 reports."
l

Luis Munoz

10/23/2019, 9:12 PM
so strange why they think startup time is important
b

bjonnh

10/23/2019, 9:42 PM
it is a detail, but it participates to first impression. And it also helps them tackling other issues.
because if you reduce useless things, you can put better things in their place.
t

tipsy

10/24/2019, 6:35 AM
so strange why they think startup time is important
To be fair, a lot of people complain about startup times. I know people who use vscode for Java because "it's light weight and starts fast". I think it's ridiculous, but I've seen a lot of people complain about it.
b

bjonnh

10/24/2019, 5:20 PM
vscode is an editor not an IDE
t

tipsy

10/24/2019, 5:29 PM
i agree with that, but it's still competition for them
👍 1
m

Mike

10/24/2019, 8:47 PM
I'd agree that VSCode is 'lightweight' in comparison to IntelliJ when it comes to Java coding. Lightweight on refactoring support. Lightweight on code analysis. Lightweight on static analysis, Lightweight on Git support. Lightweight on debugging, etc, etc, etc 👿 Using VSCode is likely ultimately slowing them down. I suspect they keep opening and closing their editor, and only look at a few files, whereas those of us that are heavy IntelliJ users open it at beginning of day, and 'live' in it for rest of day, so start up time is not very important.
f

fred.deschenes

10/24/2019, 9:24 PM
yeah my IntelliJ stays open for like... weeks at a time, I never understood closing and opening it multiple times a day
t

tddmonkey

10/25/2019, 7:36 AM
^^ The same as people who shut down their machine at the end of the day. I literally just close my laptop lid and that’s it. Next morning I open it and I’m ready to code in seconds
💯 1
m

Mike

10/29/2019, 1:43 AM
@poohbar So, am working in a mixed Java/Kotlin project and it was bogging down to the point that I was killing IntelliJ and starting it fresh. I then went in and disabled all non-essential plugins, and it's ticking along very nicely now. And this isn't a large project. A number of the plugins were things I don't need for Kotlin/Java. Node, Python and things like that. But one plugin I've had conflicts/issues with before is the Lombok plugin. Do you have the Lombok plugin installed and enabled? If you do, I'd try disabling it and see if that helps. And turn off any plugins you don't need for that project. I don't think Lombok and Kotlin 'play nice', and if you're using Kotlin, then you don't need Lombok anymore anyway (at least once you have a chance to migrate Lombok code to Kotlin of course)
b

bjonnh

10/29/2019, 1:54 AM
That's interesting, did you forward that to the lombok plugin devs?
m

Mike

10/29/2019, 2:04 AM
No. Generally speaking, I don't have the Lombok plugin enabled as I can appreciate what Lombok brings to the table, but I've always avoided using it. Having said that, it only seems to intermittently 'collide' with Kotlin, as I've had the Lombok plugin enabled, and had no problems with Kotlin projects, but have had issues in the past. Maybe it's a problem when one has a mixed project? Don't know enough to provide much details to anyone.
t

tipsy

10/29/2019, 8:08 AM
@Mike wow, that made a huge difference
i had already disabled a lot of plugins, but apparently lombok was the one
m

Mike

10/29/2019, 10:05 AM
Hmm. I wonder if it's a case of both of them watching for code changes and bytecode changes, and the keep triggering each other in certain scenarios. I don't have anything more than a hunch on this, but glad it helped someone else too.
p

poohbar

10/29/2019, 11:56 AM
@Mike Disabling plugins is the first thing I do. I have only the bare essentials enabled. Maybe I should disable all the Spring ones too since they don't really work anyway. I also heard that disabling inspections helps but I am not sure if I want to go too crazy with that as inspections can be really useful.
m

Mike

10/29/2019, 2:28 PM
As long as Lombok isn't a 'bare essential' for your project... I've had issues with it before, too. Seems like you have a lot of issues with IntelliJ that I don't, as I find the Spring plugins helpful. And if you disable inspections, you may as well start using VSCode or similar.
p

poohbar

10/29/2019, 5:08 PM
I use Kotlin specifically so that I wouldn't have to use Lombok 😄
💯 2
m

Mike

10/29/2019, 11:49 PM
I'm curious. As this seems to be more related to Intellij and Maven integration, have you tried toggling the Maven Runner option for 'Delegate IDE build/run to Maven'. With Gradle, having this on initially was terrible, but with improvements in Gradle and IntelliJ, I now run this way all the time. Don't know what the scenario is like on the Maven side. By the sounds of it, you can't be worse off by trying the opposite of what you currently have.
r

rustyrazorblade

10/30/2019, 11:00 PM
I’m only seeing slowness when using projects that have a lot of DSL code - specifically tornadofx
k

kqr

11/30/2019, 8:39 AM
please, did the 2019.3 resolve performance/lag issues?