- Apr 21, 2020
- 113
- 100
So I plan to move to Kotlin but first I should compact all of this spaghetti code.In other words, Java finally got features that other platforms like C++ had for years.
That's surely not easy when I'm not the original developer, and so i'm many places where the dearest Inno is making presupmtions try{}catch{Syste.err.prinltn} "oh, exception, lets pretend that nothing happened really" I just rethrow an exception so game may be unplayable now but now you can see why and I'll be expecting why. Again, with the original architecture, "if you've fixed that particular bug, please inspect 10 000 more similar places" is killing me.
Again why I'm moving to Kotlin is nullables - then i will have no presume that object anytime will be present - intentionally or not - and correct the game behaviour. Another plus is refactoring - in java i have no trick "we have no such method, but lets add a fake then refactor normally" - so i java i have to run thoroughly run all 1000 places to fix when in Kotlin i just write new fake extension function then make it "inline" refactor everywhere tp get desirable effect.
finally, i have here natural bulk functions instead of handmade java-streams - no 10000 rewrites either.
And the last: data is a code too (take a look on Gradle philosophy) so we don't need (no) JS engines, xml pasrsing and so on - just compile and run codable data.
That's my goal.