So, I hate to do this. Make a big “about me” negative fuss. But the issues that are making me quit, I feel like they are direct and explicit choices that team has made (both about what they should and shouldn’t focus on and about what to and not to carry over from more Classical languages) and I think they were extremely wrong-minded. And I feel it’s important to give this feedback that these issues are causing such friction with my use of the language on a day to day level, that despite having over 100k lines of code I would love to be able to push forward, I just have to burn that bridge and rip off the band-aid. Maybe people sympathize or maybe I’m alone in my issues.
Brief background: I’m a professional software engineer, going on seven years. Hobbyist going on twenty. In my professional life I mostly live in the C# .NET environment. But as a hobbyist, for the last four and a half years I’ve been using Kotlin in my personal projects. And in the past I’ve really been rooting for it as a language, even recommended it a few times. It’s full of special flavor syntax that just made sense and with a deep integration into a compiler that enabled really robust pre-compile-time code analysis and language functionality that depended on this.
There was one tremendously glaring weakness that I personally had trouble stomaching, but thought that they just haven’t got around to. But when they did “get around to it” it just got. SO. MUCH. WORSE. And they refuse to fix it.
I mean look at this.
val byte : Byte = -111
println(byte.toUByte()) // 145
println(byte.toUShort()) // 65425
println(byte.toUByte().toUShort()) // 145
println(byte.toInt()) // -111
println((byte.toInt() shl 24) and 0x0F000000) // 16777216
println(byte.toInt() shr 24) // -1
println(byte.toUInt()) // 4294967185
println((byte.toUInt() shl 24) and 0x0F000000u) // 16777216
println(byte.toUInt() shr 24) // 255
val ubyte : UByte = 0u
//val isZero = ubyte == 0u // compile error : cannot compare UByte with UInt
//val byte2 : Byte = 0xf3 // compile error
val ubyteArray = UByteArray(256) {0u} // Experimental because arrays of native types? Why would we have that as a first class citizen?
val x = ubyteArray[10] xor ubyteArray[30] // Enjoy your entire code base getting colored yellow.
I’m sorry. To me, this is worse than the oft-repeated Javascript casting memes. These aren’t “accidental misunderstandings when doing weird things”, this is “trying to do basic tools that I’ve always had access to and there literally is no correct way to do it.” And I absolutely shudder to think what’s going on once it gets converted to machine code. Just for trying to re-interpret data into something that you can action on.
Maybe this is just me being a weird fossil, but sometimes as a person who writes text that makes computers do things, every once in a while when typing up code, I run into data. And I like to manipulate that data. See, I get the feeling that the people in charge of this language think that bitwise operators are only ever used by strange embedded programmers who should be using Rust or by programmers who think they’re being clever and that all good-hearted developers deal in more traditional mathematical concepts like + and - rather than, you know, mathematics relevant to computer science. But (a) that makes the supposed commitment to native a joke because I can’t even imagine a use case that needs native access and accepts abysmal binary manipulation. And (b) they’re dead wrong. Data streams bombard the program from every angle. Even if you don’t deal with novel file types or data streams in your particular area because everything is just out-the-box, who has never used BINARY type in SQL? I get the idea behind it. “Don’t blindly copy over everything that previous languages did because maybe they’re not all relevant anymore.” But if they haven’t realized a mistake so fundamental as this in the time they’ve had to, then I just, yeah I’m 100% abandoning the language. There IS NO SUBSTITION for bitwise functions. These are op codes. This is how computers work. You can’t abstract it away. You can’t pretend it’s irrelevant.