[bisq-network/bisq] convert source code to kotlin (#3026)

Christoph Sturm notifications at github.com
Mon Jul 29 12:44:17 UTC 2019

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:
* I have done this on several projects already and it was always a very smooth transition
* kotlin code is easy to read for java programmers.
* idea can automatically convert java files to kotlin, without changing the semantics or api.
* kotlin can be uses as just a "better java" while we transition, and we can refactor to more idiomatic kotlin if we desire
* kotlin makes things like lombok obsolete, all kotlin objects automatically have getters and setters. 
* kotlin is from jetbrains so 1. it must be great and 2. it has great support in IDEA.
* its basically java without boilerplate and with easier ways to write funtional code. 
* kotlin makes a lot of discussions from our style guide obsolete.

for example in https://github.com/bisq-network/style/issues/12 instead of 
if (a) return X
else if (b) return Y
else return Z
you can just write 
```return if (a) X else if (b) Y else Z```

or for https://github.com/bisq-network/style/issues/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.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190729/71e590d0/attachment.html>

More information about the bisq-github mailing list