<https://en.paradigmadigital.com/dev/kotlin-just-a...
# announcements
k
It would be nice to have syntax highlighting for the kotlin blocks
otherwise the comments (in spanish) add too much noise and the actual code is hard to make out
s
we've found no kotlin syntax highlighter for wordpress
but you're absolutely right about comments
and function names
i've asked the translator to change them
thx
k
maybe you can copy the preformatted code from IDEA and paste it in Wordpress as is.
@serandel have you tried https://de.wordpress.org/plugins/wp-code-highlightjs/? I used standalone highlight.js before and it works with Kotlin
m
Yeah, the comments add to much noise. Hard to spot code that will not result in what comments say, like this:
Copy code
val peras: Int = 1
val manzanas: Int = 1
  
println(peras.equals(manzanas)) // True
println(peras == manzanas)        // True
println(peras === manzanas)      // El == de Java, False en este caso
All 3 cases will return
true
...
Even if you change them to nullable:
Copy code
val peras: Int? = 1
val manzanas: Int? = 1
Would have to assign large enough value to have them `false`:
Copy code
val peras: Int? = 128
val manzanas: Int? = 128
(same in Java)
s
@mg6maciej does the compiler reuse the same instance?
m
It's cached at runtime.
Check out
java.lang.Integer.valueOf
source.
s
you're my hero
🙃 1
published a revised version
thanks for your help! 🙂
m
Copy code
val apples: Int = 128
val oranges: Int = 128
will still return
true
.
It's much better if you have all the code in an article in a project and with tests. 🙂
Same with code in slides.
s
it was a rookie mistake
you're 100% right