Now I have one theme of two applications and I looked at both codes and realized that they are more similar … Who knows how to avoid this?
Well, themes generally refer to the visual appearance, so, well use others images and even if the GUI (General User Interface) is built in the same way, they'll still looks different.
But what worry me is the "both codes", that seem to indicate that you are talking about something radically different...
What would be the code for each unique?
Without knowing the code, nor what difference you want for the theme, no one can answer this.
But you provided a code, and once again it worry me.
Code:
fun main() {
val str = "A:B:C"
val delim = ":"
val list = str.split(delim)
println(list) // [A, B, C]
}
Let's say that it's the "both code" you talk about, and that you don't want to be similar...
What's the problem with both codes being similar exactly ?
You are asking to split a list of three letters, then to display it on the screen. There isn't hundreds way to do this, I'm not even sure that there's a dozen way to do this with a given language.
It's a rough summary, but globally speaking writing a software, it's doing what you did when you wrote the previous one, but in a different order.
You'll always have to proceed the input coming from the user, and there's not many way to do this.
You'll always have to display something on the screen, and there's not many way to do this.
You'll always have to load some data, or to save them, and here again there's not many way to do this.
You'll always have to iterate through a list, and there's what, three ways to do it, perhaps a bit more if you are inventive.
And so on, your code will always looks similar to some other code. Especially when you look at it at so low level (the core of a basic function). And it's normal.
Still globally speaking, at such low level, the more difference you see, the more you have to fear that you did it wrongly. Because your loop to count the apples, have no real reason to not looks like your loop to count the horses ; loop that itself was similar to the one you once used to count the stars.