-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert source code to kotlin #3026
Comments
The only way I see this happening is by having integration test in place. bisq-network/proposals#74 |
i think converting the sourcode to kotlin on a file per file basis should not make any logic changes or require refactorings. Still we could start using kotlin for new code and for unit and integration tests. |
also we could start using kotlin for unit tests. there are really nice kotlin test libs |
yes, but the code looks different and a reviewer has to make a decision. I see that only happening when test coverage comes up to speed and therefore can take the heat off the reviewer.
agreed |
I am super late to the project and feel free to ignore my suggestions. That being said: Kotlin is great. And yet I suggest against converting to Kotlin. By converting to Kotlin we expect newcomers to understand both Java and Kotlin. Bisq is already a very demanding project: Java 10/12, JavaFx, advanced Bitcoin, security, p2p / Tor / anonymity, cryptography, "decentralized UX", and what not. Even for advanced Java programmers, not everyone is keen to learn Kotlin. Now, if we also intend to attract experienced programmers in general (say Bitcoin experts knowing C# or Python who can pick up Java) - that is even worse. To sum up: Kotlin is great but please do not further increase project complexity by requiring two languages. |
i just don't see how kotlin increases the complexity. c# and python experts will also have an easier time writing kotlin. at its base kotlin is just java without boilerplate and encouraging immutability. and everybody is free to use as much kotlin as they want. |
I love Kotlin but your OP makes me cringe hard. You suggest to replace
with
which is ugly as hell. Maybe you want to edit that to:
as slamming all in one line is not helpful for readability and thus for security and also Edit: To be honest, the |
Java developers that started using Kotlin, don't want to go back. It's just so much better. So if we convert to Kotlin, we would not require Java anymore (although I assume the number of people familiar with Kotlin who don't know Java is negligible). On the other hand, Kotlin doesn't only reduce boilerplate by a lot, it also has way superior null-safety. Reduced boilerplate is security and null-safety is stability. Lastly, conversion can be done very quickly and the reviewer can reproduce the conversion to reduce the diff to the functional changes. I would highly recommend to at least allow new files to be in Kotlin and encourage to change files that are being worked on to Kotlin. Switching the whole code base to Kotlin would make it easier to review (3 devs do it and look at what differences they come out with, after resolving the trivial issues that normally result from automatic conversion. They would have to refrain from axing all the remaining boilerplate right away in a first big conversion.) |
As mentioned during dev call. If there is not enough developers who speak given language, then there won't be enough people to review that code. |
I recommend to stay boring. Boring Java. Boring cryptography. Boring dependencies. We already have plenty of exciting and hard engineering problems in Bisq - decentralization, anonymity, security, correctness, Bitcoin, p2p, usability, the real non-scam DAO (!!). I don't need exciting Kotlin to the mix ;) Enough is enough ;) |
its not about being exciting, its about mental load. the complexity of bisq is an argument for kotlin, not against it. complex code is easier to read in a more expressive language. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I just wanted to give my 2c from the outside joining the project after this decision was made. New languages and frameworks need champions and adoption to be successful. I think this was identified in the dev call as well with the intention to try it out for a few months to see if the benefits outweighed the costs and overhead. In the last 3 months, there has been only 1 commit using this new language
So regardless of whether or not it is better from a theoretical point of view, the reality is that other developers aren't utilizing the new language and using it for the benefits that were described. It is a good conversation for a future dev topic call. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because of inactivity. Feel free to reopen it if you think it is still relevant. |
I think we should convert all source files that we change to kotlin and write new source files in kotlin.
This may seem a bit far fetched but:
for example in bisq-network/style#12 instead of
you can just write
return if (a) X else if (b) Y else Z
or for bisq-network/style#11 vals are automatically constant which makes the discussion about final or not for local variables obsolete
If people like this idea i would just change the gradle file to allow kotlin sources too, and then we can transition as fast or as slow as we want. My suggestion would be that anytime we do a significant change to a class we first convert it to kotlin via the convert to kotlin function. Also gui classes and classes that use lombok are primary candidates to be converted.
I think reading and writing kotlin is just more fun.
The text was updated successfully, but these errors were encountered: