{"id":3913,"date":"2022-05-18T10:39:02","date_gmt":"2022-05-18T10:39:02","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway\/"},"modified":"2026-04-28T14:07:11","modified_gmt":"2026-04-28T14:07:11","slug":"af-hverju-kotlin-er-aedislegt-en-thu-munt-samt-sem-adur-vera-afram-med-java-1","status":"publish","type":"post","link":"https:\/\/thecodest.co\/is\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/","title":{"rendered":"Af hverju Kotlin er fr\u00e1b\u00e6rt, en \u00fe\u00fa munt samt sem \u00e1\u00f0ur nota Java"},"content":{"rendered":"<p>\u00d3h\u00e1\u00f0 \u00fev\u00ed \u00ed hva\u00f0a h\u00f3p \u00fe\u00fa tilheyrir, er \u00e1st\u00e6\u00f0a fyrir \u00fev\u00ed a\u00f0 \u00fe\u00fa dvelur hj\u00e1 <strong><a href=\"https:\/\/thecodest.co\/is\/blog\/find-the-right-java-developer-now\/\">Java<\/a><\/strong>. Og \u00e9g kenni \u00fe\u00e9r ekki um. \u00dea\u00f0 hefur ef til vill mest \u00fer\u00f3a\u00f0a, alhli\u00f0a og fullkomnustu vistkerfi\u00f0 \u00ed heild <a href=\"https:\/\/thecodest.co\/is\/dictionary\/what-is-enterprise-hybrid-cloud\/\">fyrirt\u00e6ki<\/a> heims. Forritunarm\u00e1li\u00f0 hefur vel sni\u00f0i\u00f0 safn af m\u00f6guleikum, einhvers sta\u00f0ar \u00ed r\u00e9ttri svi\u00f0i milli of mikils og of l\u00edtils. Og n\u00fdir eiginleikar eru sm\u00e1m saman en st\u00f6\u00f0ugt b\u00e6ttir vi\u00f0, sem heldur \u00fev\u00ed a\u00f0 mestu uppf\u00e6r\u00f0u me\u00f0 n\u00fdjustu straumum \u00ed forritunarheiminum.<\/p>\n\n\n\n<p>Veit \u00fe\u00fa <a href=\"https:\/\/projectlombok.org\">Lombok<\/a> En hva\u00f0 ef \u00fe\u00fa gerir \u00fea\u00f0 ekki? Ef \u00fe\u00fa gerir \u00fea\u00f0 ekki, m\u00e6li \u00e9g eindregi\u00f0 me\u00f0 a\u00f0 \u00fe\u00fa pr\u00f3fir. Ef \u00fe\u00e9r l\u00edkar \u00fea\u00f0, \u00fe\u00e1 hef \u00e9g eitthva\u00f0 s\u00e9rstaklega fyrir \u00feig til a\u00f0 pr\u00f3fa. Alveg n\u00fdtt forritunarm\u00e1l sem, me\u00f0 eiginleikum s\u00ednum, gerir Lombok \u00farelt. \u00dea\u00f0 heitir <b>Kotlin<\/b>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Kotlin? \u00de\u00fa meinar Android-m\u00e1li\u00f0?<\/h2>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/pClXBLD.jpg\" alt=\"J\u00e6ja j\u00e1, en \u00ed raun ekki\"\/><\/figure>\n\n\n\n<p>Kotlin \u00e1 Android hlaut blessun Google sj\u00e1lfs og var\u00f0 de-facto forritunarm\u00e1l vettvangsins. \u00deetta er ekki \u00fea\u00f0 sem \u00e9g mun einbeita m\u00e9r a\u00f0 \u00ed \u00feessari grein, en Android er sannarlega s\u00e1 sta\u00f0ur \u00fear sem \u00e9g hitti Kotlin \u00ed fyrsta sinn.<\/p>\n\n\n\n<p>Vinnuf\u00e9lagi minn var a\u00f0 \u00fer\u00f3a forrit fyrir \u00fe\u00e1verandi n\u00faverandi <a href=\"https:\/\/thecodest.co\/is\/dictionary\/why-do-projects-fail\/\">verkefni<\/a>, sj\u00e1lfur. En skilafrestirnir n\u00e1lgu\u00f0ust hratt, svo m\u00e9r var fali\u00f0 a\u00f0 hj\u00e1lpa honum a\u00f0 standa vi\u00f0 \u00fe\u00e1. Leyf\u00f0u m\u00e9r n\u00fa a\u00f0 f\u00e6ra mig aftur til \u00feess augnabliks. Aaaand\u2026 J\u00c6JA! Hvers vegna er hann a\u00f0 nota einhvern undarlegt tungum\u00e1l sem hlj\u00f3mar eins og a <a href=\"https:\/\/www.ketchupy.pl\/images\/3\/c\/9\/4\/5\/3c9453c5b720f810c293211d77449d9395f09944-product-front-1.png\">kechupv\u00f6rumerki<\/a>!? \u00dea\u00f0 l\u00edtur hr\u00e6\u00f0ilega \u00fat!<\/p>\n\n\n\n<p>Hvers vegna er \u201cfun\u201d skrifa\u00f0 fyrir framan hverja fall? Eins og \u00e9g viti ekki n\u00fa \u00feegar hva\u00f0 \u00fea\u00f0 er. Einnig er \u00e9g n\u00fa \u00feegar a\u00f0 hafa <em>skemmtilegur<\/em> me\u00f0 <strong>Java<\/strong> Allavega. Og hvar er skilartegian? \u00cd lokin? Ertu klikka\u00f0ur? Hva\u00f0 er \u00feetta, ertu a\u00f0 \u00fathluta einhverju \u00ed fall? \u00deetta er algj\u00f6rlega \u00fat \u00ed h\u00f6tt! \u00deetta l\u00edtur allt bara \u00fat eins og <b>Java me\u00f0 aukaskrefum!<\/b> B\u00edddu, hvar er flokkurinn sem \u00feessi a\u00f0fer\u00f0 tilheyrir? Hvar faldistu hann, \u00fe\u00fa sem hlj\u00f3mar eins og ketchup, <strong>Java<\/strong> hermdi forritunarm\u00e1ls? \u00d3 nei. \u00d3 nei, \u00fe\u00fa ger\u00f0ir \u00fea\u00f0 ekki. ER \u00deETTA GL\u00d3BALT STARF? \u00dea\u00f0 er n\u00f3g komi\u00f0, \u00e9g er b\u00fainn, \u00e9g hringi \u00ed l\u00f6gregluna.<\/p>\n\n\n\n<p>Vi\u00f0v\u00f6run: \u00c9g hringdi ekki \u00e1 l\u00f6gregluna. Hvort sem m\u00e9r l\u00edka\u00f0i \u00fea\u00f0 betur e\u00f0a verr \u00feurfti \u00e9g a\u00f0 a\u00f0laga Java-mi\u00f0a\u00f0a hugsunarh\u00e1ttinn minn til a\u00f0 taka vi\u00f0 \u00f6\u00f0ru forritunarm\u00e1li. En \u00fea\u00f0 ver\u00f0ur samt ekki svo sl\u00e6mt, er \u00fea\u00f0 ekki? \u00dea\u00f0 er samt enn JVM-m\u00e1l, vissulega er \u00fea\u00f0 bara anna\u00f0 <strong>Java<\/strong>. Kannski jafnvel me\u00f0 nokkrum flottum vi\u00f0b\u00f3tareiginleikum? \u00c9g byrja\u00f0i tregt a\u00f0 vinna a\u00f0 verkefninu.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Java me\u00f0 aukaskrefum<\/h2>\n\n\n\n<p><em>Ef Java er svo fr\u00e1b\u00e6rt, af hverju er \u00fe\u00e1 ekki Java 2?<\/em> Gr\u00ednilega s\u00e9\u00f0, \u00fea\u00f0 var \u00fea\u00f0 sem \u00e9g hugsa\u00f0i m\u00e9r. \u00c9g \u00e6tla bara a\u00f0 l\u00e1ta eins og Kotlin s\u00e9 Java 2. N\u00fdtt m\u00e1lfar og allt, en \u00e9g \u00fearf bara a\u00f0 l\u00e6ra n\u00f3g til a\u00f0 kl\u00e1ra verkefni\u00f0. \u00d3, hva\u00f0 \u00e9g haf\u00f0i rangt fyrir m\u00e9r.<\/p>\n\n\n\n<p>Eftir a\u00f0 hafa pr\u00f3fa\u00f0 \u00fea\u00f0 \u00ed a\u00f0eins einn e\u00f0a tvo daga \u00e1tta\u00f0i \u00e9g mig flj\u00f3tt \u00e1 \u00fev\u00ed a\u00f0 b\u00e6\u00f0i Kotlin og <strong>Java<\/strong> eru ekki teygjanleg. A\u00f0 reyna a\u00f0 beygja \u00feau a\u00f0 hvoru \u00f6\u00f0ru endar \u00f3hj\u00e1kv\u00e6milega me\u00f0 \u00fev\u00ed a\u00f0 eitt \u00feeirra brotnar \u00ed tvennt. \u00dea\u00f0 var\u00f0 auglj\u00f3st a\u00f0 Kotlin er sj\u00e1lfst\u00e6\u00f0 eining, og s\u00fa sta\u00f0reynd a\u00f0 \u00fea\u00f0 keyrir \u00e1 JVM \u00fe\u00fd\u00f0ir n\u00e1nast ekkert fr\u00e1 sj\u00f3narh\u00f3li forritara. (Auk \u00feess getur \u00fea\u00f0 einnig \u00fe\u00fd\u00f0st \u00ed <a href=\"https:\/\/thecodest.co\/is\/blog\/hire-javascript-developer\/\">JavaScript<\/a>, e\u00f0a sam\u00fe\u00e6tt \u00ed innf\u00e6ddan tv\u00edbuta).<\/p>\n\n\n\n<p>\u00c1\u00e6tlun B \u00fe\u00e1. Reyndar, kynnstu forritunarm\u00e1linu. A\u00f0 lesa skj\u00f6lin \u00ed fyrsta sinn sendir hroll um hrygginn \u00e1 reyndum Java-forritara. Til d\u00e6mis:<br>\u2013 \u00e1\u00f0ur nefndur efsta stig, \u00fe.e. al\u00fej\u00f3\u00f0legur samhengi<br>\u2013 ger\u00f0ir breyta og gildisendunar fallager\u00f0a tilgreindar \u00ed lokin<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code>fun sum(a: Int, b: Int): Int {\n   return a + b\n}<\/code>Hlj\u00f3\u00f0skrift<\/pre>\n\n\n\n<p>Funktsj\u00f3nar l\u00edkami getur veri\u00f0 tj\u00e1ning (me\u00f0 jafnmerki)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code> skemmtilegt sum(a: Heill tala, b: Heill tala) = a + b<\/code>Hlj\u00f3\u00f0skrift<\/pre>\n\n\n\n<p>if-skilyr\u00f0i getur skila\u00f0 ni\u00f0urst\u00f6\u00f0u<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">val y = if (x == 1) {\n \"one\"\n } else if (x == 2) {\n \"two\"\n } else {\n \"other\"\n }<\/code>Hlj\u00f3\u00f0skrift<\/pre>\n\n\n\n<p>Ok, \u00e9g \u00fearf bara a\u00f0 venjast \u00feessu. Bara \u00f6nnur setningager\u00f0. Hva\u00f0 anna\u00f0 hefur\u00f0u upp \u00e1 a\u00f0 bj\u00f3\u00f0a, herra Kotlin?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code> value?.method() \/\/ framkv\u00e6ma ef ekki null<\/code>Hlj\u00f3\u00f0skrift<\/pre>\n\n\n\n<p>\u00d3kei, a\u00f0 losna vi\u00f0 <code>Ef gildi\u00f0 er null<\/code>, eitt stig fyrir \u00feig. Hva\u00f0 meira hefur\u00f0u?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">```\nfun check(list: List, alternative: Boolean) = when {\n list is LinkedList -&gt; print(\"linked\")\n alternative -&gt; print(\"alternative\")\n list.size &gt; 50 -&gt; print(\"big\")\n else -&gt; print(\"other\")\n }\n```<\/code>Hlj\u00f3\u00f0skrift<\/pre>\n\n\n\n<p>Hmm, flott, g\u00e6ti veri\u00f0 gagnlegt til a\u00f0 for\u00f0ast if-else-blokkir, en \u00fea\u00f0 vir\u00f0ist samt vera sm\u00e1 gervi.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">class SingularObject: Counter() {\n var a = 14\n fun test() = if (a &gt; 10) \"more\" else \"less\"\n }<\/code>Hlj\u00f3\u00f0skrift<\/pre>\n\n\n\n<p>Ok, \u00feetta l\u00edtur virkilega gagnlegt \u00fat, m\u00e9r l\u00edkar \u00fea\u00f0! \u00c1 hinn b\u00f3ginn get \u00e9g l\u00edka b\u00fai\u00f0 til singleton \u00ed Java. Kannski ver\u00f0ur \u00fea\u00f0 ekki eins f\u00e1ga\u00f0, en \u00fea\u00f0 er ekkert n\u00fdtt \u00ed raun. \u00c1ttu eitthva\u00f0 ess \u00ed erminni? Svona alv\u00f6ru st\u00f3rskotali\u00f0?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\"><code> var s: String = null \/\/ ekki samh\u00e6ft, ekki-null-ger\u00f0<\/code>Hlj\u00f3\u00f0skrift<\/pre>\n\n\n\n<p>B\u00edddu\u2026 hva\u00f0?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Tony_Hoare#Apologies_and_retractions\">Milljar\u00f0a dollara mist\u00f6kin<\/a><\/h2>\n\n\n\n<p>\u00cdmynda\u00f0u \u00fe\u00e9r k\u00f3\u00f0agrunn \u00fear sem \u00fe\u00fa \u00fearft ekki a\u00f0 hafa \u00e1hyggjur af null-\u00f6ryggi. \u00cdmynda\u00f0u \u00fe\u00e9r a\u00f0 taka \u00fea\u00f0 sem sj\u00e1lfs\u00f6g\u00f0um hlut a\u00f0 hver tilv\u00edsun innihaldi \u00ed raun eitthva\u00f0 merkingarb\u00e6rt. \u00cdmynda\u00f0u \u00fe\u00e9r a\u00f0 vera viss um a\u00f0 \u00f6ll null-tengd vandam\u00e1l hafi veri\u00f0 leyst fyrirfram.<br>\u00cdmynda\u00f0u \u00fe\u00e9r ekki meira. \u00d6ll tilv\u00edsanir \u00ed Kotlin eru ekki nullanlegar sj\u00e1lfgefi\u00f0. Ef \u00fe\u00fa vilt gera \u00fe\u00e6r nullanlegar, ver\u00f0ur \u00fe\u00fa a\u00f0 <u>me\u00f0vita\u00f0<\/u> taka \u00fe\u00e1 \u00e1kv\u00f6r\u00f0un og <u>sk\u00fdrt<\/u> segja \u00fea\u00f0 \u00ed <a href=\"https:\/\/thecodest.co\/is\/dictionary\/what-is-code-refactoring\/\">k\u00f3\u00f0i<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">var s: String? = null\n<\/code>Hlj\u00f3\u00f0skrift<\/pre>\n\n\n\n<p>\u00c9g skil a\u00f0 \u00fe\u00fa g\u00e6tir veri\u00f0 tortrygginn \u00e1 alla hugmyndina \u00e1 \u00feessum t\u00edmapunkti. \u00de\u00fa ert vanur nullable-tilv\u00edsunum. \u00de\u00fa hefur \u00fea\u00f0 \u00ed huga \u00feegar \u00fe\u00fa k\u00f3\u00f0ar. \u00de\u00fa l\u00e6r\u00f0ir hvar \u00fe\u00fa \u00fearft a\u00f0 vera vark\u00e1r. N\u00e1kv\u00e6mlega m\u00ednar hugsanir. Fr\u00e1 <strong>Java<\/strong>, \u00fea\u00f0 fannst m\u00e9r \u00ed raun skr\u00edti\u00f0 \u00ed fyrstu. Eins og, hva\u00f0 er tilgangurinn? \u00dea\u00f0 \u00e6tlar ekki a\u00f0 l\u00e1ta \u00f6ll tengd vandam\u00e1l hverfa me\u00f0 t\u00f6frum. \u00c9g \u00fearf bara a\u00f0 b\u00e6ta \u201c?\u201d alls sta\u00f0ar, \u00fea\u00f0 hlj\u00f3mar eins og lei\u00f0inlegt verk.<\/p>\n\n\n\n<p>En \u00e9g \u00e1kva\u00f0 a\u00f0 kafa dj\u00fapt \u00ed tungum\u00e1li\u00f0, ekki satt? Skulum gera \u00fea\u00f0 \u00e1 \u00feinn h\u00e1tt, herra. <strong>Kotlin<\/strong>. \u00c9g byrja\u00f0i a\u00f0 leggja mig fram um a\u00f0 \u00fatr\u00fdma eins m\u00f6rgum null-gildum og m\u00f6gulegt var. Skref fyrir skref l\u00e6r\u00f0i \u00e9g a\u00f0 nota tungum\u00e1lseiginleika sem ger\u00f0u \u00fea\u00f0 au\u00f0veldara a\u00f0 \u00fatr\u00fdma null-tilv\u00edsunum, t.d. \u00f6rugga k\u00f6llun (\u201c?.\u201d), elvis-skilyr\u00f0i (\u201c?:\u201d), umbo\u00f0seiginleika, \u201clet\u201d-a\u00f0fer\u00f0 og fleira.<\/p>\n\n\n\n<p>Me\u00f0 t\u00edmanum t\u00f3kst m\u00e9r a\u00f0 gera nokkur flokkar eing\u00f6ngu me\u00f0 reiti og a\u00f0fer\u00f0aparametra sem aldrei g\u00e1tu veri\u00f0 null. \u00cd grundvallaratri\u00f0um vissi \u00e9g a\u00f0 ef flokkur var vel instansa\u00f0ur gat \u00e9g n\u00e1nast gleymt null-m\u00f6guleikum \u00ed a\u00f0fer\u00f0ark\u00f3\u00f0unum. \u00dea\u00f0 var hreinn una\u00f0ur. Me\u00f0 t\u00edmanum ger\u00f0i \u00e9g m\u00e9r s\u00edfellt meiri grein fyrir \u00feessu. A\u00f0 lokum taldi \u00e9g \u00fea\u00f0 \u00fe\u00f3 ekki vera banv\u00e6na eiginleika., <strong>Java<\/strong> Fannst enn eins og heima. \u00deanga\u00f0 til\u2026<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Koma aftur<\/h2>\n\n\n\n<p>Verkefni\u00f0 var a\u00f0 n\u00e1lgast lokin. \u00c9g kynntist Kotlin s\u00edfellt betur og me\u00f0 \u00feeirri \u00feekkingu var\u00f0 k\u00f3\u00f0inn s\u00edfellt snyrtilegri, l\u00e6silegri og hnitmi\u00f0a\u00f0ri. Ma\u00f0ur s\u00e1 framfarirnar berum augum \u00ed commit-s\u00f6gunni. En t\u00edminn er loksins kominn. Me\u00f0 \u00f3v\u00e6nt j\u00e1kv\u00e6\u00f0um minningum um n\u00fdja forritunarm\u00e1li\u00f0 var kominn t\u00edmi til a\u00f0 kve\u00f0ja og sn\u00faa aftur \u00ed s\u00e6tu \u00fe\u00e6gindasv\u00e6\u00f0i\u00f0 <strong>Java<\/strong>. E\u00f0a svo h\u00e9lt \u00e9g.<\/p>\n\n\n\n<p>\u00deekkir\u00f0u \u00fe\u00e1 tilfinningu \u00feegar \u00fe\u00fa byrjar a\u00f0 meta eitthva\u00f0 akk\u00farat \u00e1 \u00feeim augnabliki sem \u00fea\u00f0 hverfur? \u00deegar \u00fe\u00fa \u00e1ttar \u00feig ekki \u00e1 \u00fev\u00ed hversu miki\u00f0 \u00fe\u00fa treystir \u00e1 eitthva\u00f0 fyrr en \u00fe\u00fa getur ekki nota\u00f0 \u00fea\u00f0 lengur? \u00deetta var besta d\u00e6mi\u00f0 um \u00fe\u00e1 tilfinningu sem \u00e9g hef l\u00edklega nokkurn t\u00edma upplifa\u00f0 \u00ed l\u00edfi m\u00ednu.<\/p>\n\n\n\n<p>\u00deegar \u00e9g kom aftur a\u00f0 \u00fev\u00ed a\u00f0 skrifa k\u00f3\u00f0ann \u00ed <strong>Java<\/strong>, \u00c9g var n\u00e6stum \u00fev\u00ed hr\u00e6ddur vi\u00f0 skort \u00e1 \u00e1kve\u00f0num eiginleikum. \u00dea\u00f0 var eins og heilinn minn, undirvitundarlega, hef\u00f0i ranglega b\u00e6tt Kotlin-eiginleikum inn \u00ed Java. \u00c9g lenti \u00ed a\u00f0st\u00e6\u00f0um \u00fear sem \u00e9g byrja\u00f0i a\u00f0 innlei\u00f0a eitthva\u00f0, a\u00f0eins til a\u00f0 \u00e1tta mig \u00e1 \u00fev\u00ed a\u00f0 \u00fea\u00f0 myndi ekki virka \u00ed \u00feessu forritunarm\u00e1li. \u00cd besta falli gat \u00e9g skrifa\u00f0 \u00fea\u00f0 \u00e1 Kotlin-l\u00edkan h\u00e1tt, en \u00fea\u00f0 var klunnalegt, \u00f3lesanlegt og\/e\u00f0a kraf\u00f0ist of mikils upphitunark\u00f3\u00f0a.<\/p>\n\n\n\n<p>Null-\u00f6ryggi var au\u00f0vita\u00f0 s\u00fa eiginleiki sem \u00e9g sakna\u00f0i mest. En \u00e9g var hissa \u00e1 hversu margir sm\u00e6rri hlutir ur\u00f0u m\u00e9r e\u00f0lilegir: nafnkenndir breytur, eiginleikar \u00ed sta\u00f0 getta og setta, \u201c==\u201d sem jafnmerki og \u201c===\u201d sem tilv\u00edsunarsamkv\u00e6mni, sk\u00fdr \u201cthis\u201d, vi\u00f0b\u00f3tarfall, \u00f3beinn einstaklingsbundinn lambda-parametri, \u201c_\u201d fyrir \u00f3nota\u00f0a lambda-parametra, <a href=\"https:\/\/thecodest.co\/is\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">g\u00f6gn<\/a> Flokkar, svi\u00f0sfall, \u00f6nnur Kotlin-sta\u00f0alb\u00f3kasafnsfall, rekstrara\u00f0ger\u00f0ir og fleira. Og hvernig allt fellur svo vel saman. \u00cd samanbur\u00f0i fannst Java\u2026 frumst\u00e6\u00f0.<\/p>\n\n\n\n<p>M\u00e9r lei\u00f0 svo illa a\u00f0 \u00e9g f\u00f3r a\u00f0 \u00edhuga a\u00f0 skipta alfari\u00f0 yfir \u00ed Kotlin. Fr\u00e6\u00f0ilega s\u00e9\u00f0 er \u00fea\u00f0 fullkomlega samh\u00e6ft vi\u00f0 Java; \u00fe\u00fa getur einfaldlega b\u00e6tt Kotlin-stu\u00f0ningi vi\u00f0 n\u00faverandi verkefni og byrja\u00f0 a\u00f0 skrifa n\u00fdjar klassa. Kotlin-hli\u00f0in veit hvernig \u00e1 a\u00f0 \u201ctala\u201d vi\u00f0 Java, en Java-hli\u00f0in veit ekki einu sinni a\u00f0 h\u00fan s\u00e9 a\u00f0 \u201ctala\u201d vi\u00f0 anna\u00f0 forritunarm\u00e1l. Og eftir \u00fe\u00fd\u00f0ingu \u00ed bytecode skiptir \u00fea\u00f0 \u00ed raun engu m\u00e1li fyrir JVM.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><a href=\"https:\/\/calendly.com\/the-codest-java-consulting\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/meeting_java_expert.png\" alt=\"Kynntu \u00fe\u00e9r Java-s\u00e9rfr\u00e6\u00f0inginn\"\/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Veruleikapr\u00f3f<\/h2>\n\n\n\n<p>Svo hva\u00f0 ertu a\u00f0 b\u00ed\u00f0a eftir? Ef forritunarm\u00e1li\u00f0 er eins gott og \u00fe\u00fa segir, nota\u00f0u \u00fea\u00f0 bara! Kannski ekki \u00ed n\u00faverandi verkefnum \u00fe\u00f3; \u00e9g veit a\u00f0 \u00fea\u00f0 \u00e6tti a\u00f0 vera samh\u00e6ft, en a\u00f0 blanda saman tveimur mismunandi forritunarm\u00e1lum svona hlj\u00f3mar lj\u00f3tt.<\/p>\n\n\n\n<p>Ok, svo fyrir n\u00fdja m\u00f3tornar \u2013 Kotlin er \u00fea\u00f0. E\u00f0a er \u00fea\u00f0? \u00de\u00fa ert a\u00f0 vinna \u00ed a <a href=\"https:\/\/thecodest.co\/is\/blog\/how-to-hire-the-best-outsourced-development-team-for-a-scaleup\/\">li\u00f0<\/a>. \u00de\u00fa \u00fearft a\u00f0 r\u00e1\u00f0f\u00e6ra \u00feig vi\u00f0 \u00fe\u00e1 og sannf\u00e6ra \u00fe\u00e1 um \u00e1g\u00e6ti \u00feessa n\u00fdja tungum\u00e1ls. Hva\u00f0? \u00deeim l\u00edkar \u00fea\u00f0 ekki? \u00dea\u00f0 hlj\u00f3mar eins og \u00feeir vilji einfaldlega ekki leggja sig fram vi\u00f0 a\u00f0 l\u00e6ra \u00fea\u00f0. En \u00fe\u00fa getur ekki kennt \u00feeim um, \u00fe\u00fa varst l\u00edka tortrygginn \u00ed fyrstu.<\/p>\n\n\n\n<p>Verkefnisstj\u00f3rinn! J\u00e1! Hann mun vissulega skilja hina miklu gildi sem Kotlin myndi f\u00e6ra \u00ed okkar team. \u00d3, hversu mikill vegur mun koma!<br>-Nei<br>-B\u00edddu, af hverju?<br>-team veit \u00fea\u00f0 ekki.<br>-\u00deeir munu l\u00e6ra!<br>-\u00deeir vilja ekki l\u00e6ra.<br>-\u00de\u00fa getur gert \u00feau!<br>-\u00deeir \u00feurfa ekki a\u00f0 l\u00e6ra.<br>-\u00c9g meina, \u00fea\u00f0 er satt, en hugsa\u00f0u um m\u00f6guleikana!<br>-J\u00e1, hva\u00f0 me\u00f0 a\u00f0 \u00fe\u00fa hugsa\u00f0ir fyrst um vandam\u00e1lin.<\/p>\n\n\n\n<p>Go\u00f0s\u00f6gnin segir a\u00f0 til s\u00e9u verkefni. Verkefni sem er st\u00f3rt og fl\u00f3ki\u00f0, en vel skrifa\u00f0 \u00ed hverju einasta atri\u00f0i. Verkefni \u00fear sem allir forritarar eru samm\u00e1la um notu\u00f0 lausnir. \u00dear sem n\u00fdir eiginleikar renna hn\u00f6kralaust af lyklabor\u00f0um forritaranna. \u00dear sem villur eru sjaldg\u00e6far og au\u00f0velt er a\u00f0 laga \u00fe\u00e6r.<\/p>\n\n\n\n<p>Hefur\u00f0u s\u00e9\u00f0 verkefni eins og \u00feetta? \u00c9g hef \u00fea\u00f0 ekki. Sumir komust n\u00e1l\u00e6gt \u00fev\u00ed, en flest \u00feeirra eru \u00ed raun algj\u00f6r \u00f3rei\u00f0a \u00ed erf\u00f0ak\u00f3\u00f0a. Og ef \u00feau eru \u00fea\u00f0 ekki, munu \u00feau l\u00edklega ver\u00f0a \u00fea\u00f0 einhvern t\u00edma \u00ed framt\u00ed\u00f0inni. N\u00fa \u00edmynda \u00fe\u00e9r a\u00f0 b\u00e6ta enn einu forritunarm\u00e1linu vi\u00f0 blandi\u00f0. \u00dea\u00f0 opnar upp \u00e1 n\u00fdjar lei\u00f0ir til a\u00f0 gera mist\u00f6k. \u00dea\u00f0 krefst \u00feess a\u00f0 forritarar viti hva\u00f0 \u00feeir eru a\u00f0 gera. \u00dea\u00f0 er \u00e1h\u00e6tta, a\u00f0 minnsta kosti.<\/p>\n\n\n\n<p>\u00cdhuga\u00f0u n\u00fa einnig <a href=\"https:\/\/thecodest.co\/is\/blog\/hire-vue-js-developers\/\">\u00fer\u00f3unara\u00f0ili<\/a> Vi\u00f0sn\u00faningur. F\u00f3lk kemur og fer. \u00c6tlar\u00f0u a\u00f0 l\u00e1ta hvern n\u00fdjan forritara l\u00e6ra alveg n\u00fdtt forritunarm\u00e1l? Nei, \u00fea\u00f0 er gagnslaust. \u00c6tlar\u00f0u yfir h\u00f6fu\u00f0 a\u00f0 r\u00e1\u00f0a Kotlin-forritara? Gangi \u00fe\u00e9r vel me\u00f0 \u00fea\u00f0, \u00fea\u00f0 er n\u00f3g erfitt a\u00f0 r\u00e1\u00f0a g\u00f3\u00f0an Java-forritara.<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.allegro.tech\/2018\/05\/From-Java-to-Kotlin-and-Back-Again.html\">F\u00f3lk hefur reynt.<\/a> \u00c9g ver\u00f0 a\u00f0 segja a\u00f0 \u00e9g s\u00e9 ekki samm\u00e1la flestum \u00e1s\u00f6kunum \u00ed \u00feeirri grein. \u00dea\u00f0 er nokkur r\u00e9ttm\u00e6t gagnr\u00fdni \u00ed henni, en \u00e9g tel a\u00f0 \u00feeir hafi ekki nota\u00f0 Kotlin n\u00e6gilega til a\u00f0 skilja \u201cKotlin-h\u00e1ttinn\u201d. Margir sem skrifu\u00f0u athugasemdir undir greininni vir\u00f0ast vera \u00e1 svipa\u00f0ri sko\u00f0un.<\/p>\n\n\n\n<p>En \u00fea\u00f0 skiptir engu m\u00e1li. \u00c9g ve\u00f0ja a\u00f0 \u00feetta myndi gerast \u00ed verkefni \u00fe\u00ednu l\u00edka. \u201cPr\u00f3fa\u00f0i \u00fea\u00f0, l\u00edka\u00f0i \u00fea\u00f0 ekki\u201d. \u00de\u00fa munt ekki f\u00e1 \u00fe\u00e1 til a\u00f0 ey\u00f0a meiri t\u00edma \u00ed \u00fea\u00f0. \u00de\u00fa munt ekki f\u00e1 \u00fe\u00e1 til a\u00f0 pr\u00f3fa aftur. \u00de\u00fa munt ekki f\u00e1 \u00fe\u00e1 til a\u00f0 gefa \u00fev\u00ed anna\u00f0 t\u00e6kif\u00e6ri. Og fr\u00e1 hagn\u00fdtu sj\u00f3narhorni g\u00e6tu \u00feeir haft r\u00e9tt fyrir s\u00e9r. <strong>Java<\/strong> er bara svo vins\u00e6ll a\u00f0 \u00fea\u00f0 vir\u00f0ist \u00f3\u00fearfi a\u00f0 nota neitt anna\u00f0 \u00e1 JVM.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Hvers vegna \u00feessi grein \u00fe\u00e1?<\/h2>\n\n\n\n<p>\u00de\u00fa eyddir t\u00f6luver\u00f0um t\u00edma \u00ed a\u00f0 skrifa grein sem vir\u00f0ist engan tilgang hafa. Hvers vegna \u00e6tti \u00e9g a\u00f0 reyna a\u00f0 l\u00e6ra tungum\u00e1l ef \u00fe\u00fa segir a\u00f0 \u00fea\u00f0 s\u00e9 samt sem \u00e1\u00f0ur tilgangslaust?<\/p>\n\n\n\n<p>J\u00e6ja, \u00e9g tel \u00fea\u00f0 ekki tilgangslaust. \u00c9g tel enn a\u00f0 Kotlin s\u00e9 fr\u00e1b\u00e6rt. \u00c9g vil enn \u00ed alv\u00f6ru nota \u00fea\u00f0 (og \u00e9g nota \u00fea\u00f0 reyndar \u00ed m\u00ednum einkaverkefnum). Ef \u00e9g g\u00e6ti, myndi \u00e9g einfaldlega skipta yfir \u00ed \u00fea\u00f0 og gleyma takm\u00f6rkunum Java. En raunin er s\u00fa a\u00f0 \u00e9g get \u00fea\u00f0 ekki. Og \u00e9g vil reyna a\u00f0 breyta \u00fev\u00ed.<\/p>\n\n\n\n<p>M\u00edn \u00f3sk til \u00fe\u00edn, k\u00e6ri lesandi, er a\u00f0 \u00fe\u00fa \u00edhugir a\u00f0 minnsta kosti a\u00f0 st\u00edga \u00fat \u00far \u00fe\u00e6gilega Java-\u00fe\u00e6gindasv\u00e6\u00f0inu. \u00dev\u00ed kannski, bara kannski, munt \u00fe\u00fa elska Kotlin jafnmiki\u00f0 og \u00e9g geri. Og ef \u00fe\u00fa gerir \u00fea\u00f0, \u00fe\u00e1 er \u00fea\u00f0 einn fleiri Kotlin-kunnandi forritari \u00e1 <a href=\"https:\/\/thecodest.co\/is\/dictionary\/what-is-the-size-of-your-potential-reachable-market\/\">marka\u00f0ur<\/a>.<\/p>\n\n\n\n<p><strong>Lesa meira:<\/strong><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/the-best-type-of-projects-for-java\">Besti ger\u00f0ir verkefna fyrir Java<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/3-common-challenges-of-software-product-development-for-startups\">3 algengir \u00e1skoranir \u00ed hugb\u00fana\u00f0arv\u00f6rufram\u00fer\u00f3un hj\u00e1 sprotafyrirt\u00e6kjum<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/thecodest.co\/blog\/the-right-way-to-find-top-java-developers\">R\u00e9tti h\u00e1tturinn til a\u00f0 finna bestu Java-\u00fer\u00f3unara\u00f0ila<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>Ef \u00fe\u00fa ert Java-\u00fer\u00f3unara\u00f0ili, er l\u00edklegt a\u00f0 \u00fe\u00fa hafir a\u00f0 minnsta kosti einhverja reynslu af \u00f6\u00f0rum forritunarm\u00e1lum. Sumir okkar h\u00f3fu forritunar\u00e6vint\u00fdri\u00f0 sitt me\u00f0 \u00f6\u00f0ru forritunarm\u00e1li eins og C\/C++, JavaScript, C#, Python e\u00f0a jafnvel eitthva\u00f0 eins og Pascal e\u00f0a Basic. Sumir byrju\u00f0u hins vegar me\u00f0 Java og hafa einfaldlega ekki veitt \u00f6\u00f0rum forritunarm\u00e1lum mikla athygli, me\u00f0 \u00f3\u00fe\u00e6gilegri minningu um eina tiltekna atbur\u00f0ar\u00e1s \u00feegar \u00feeir \u00feurftu a\u00f0 k\u00f3\u00f0a eitthva\u00f0 flj\u00f3tt \u00e1 fronthli\u00f0inni.<\/p>","protected":false},"author":2,"featured_media":3914,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3913","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Why Kotlin is awesome, but you will stay with Java anyway - The Codest<\/title>\n<meta name=\"description\" content=\"If you are a Java developer, chances are you have at least some experience with other programming languages. Some of us started their programming adventure with another language like C\/C++, JavaScript, C#, Python or maybe even something like Pascal or Basic. Some, though, started with Java and just never paid too much attention to other languages, unpleasantly remembering the one time when they needed to quickly code something on the frontend side.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/is\/blogg\/af-hverju-kotlin-er-aedislegt-en-thu-munt-samt-sem-adur-vera-afram-med-java-1\/\" \/>\n<meta property=\"og:locale\" content=\"is_IS\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why Kotlin is awesome, but you will stay with Java anyway\" \/>\n<meta property=\"og:description\" content=\"If you are a Java developer, chances are you have at least some experience with other programming languages. Some of us started their programming adventure with another language like C\/C++, JavaScript, C#, Python or maybe even something like Pascal or Basic. Some, though, started with Java and just never paid too much attention to other languages, unpleasantly remembering the one time when they needed to quickly code something on the frontend side.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/is\/blogg\/af-hverju-kotlin-er-aedislegt-en-thu-munt-samt-sem-adur-vera-afram-med-java-1\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-18T10:39:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-28T14:07:11+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Why Kotlin is awesome, but you will stay with Java anyway\",\"datePublished\":\"2022-05-18T10:39:02+00:00\",\"dateModified\":\"2026-04-28T14:07:11+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/\"},\"wordCount\":1973,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"is\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/\",\"name\":\"Why Kotlin is awesome, but you will stay with Java anyway - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png\",\"datePublished\":\"2022-05-18T10:39:02+00:00\",\"dateModified\":\"2026-04-28T14:07:11+00:00\",\"description\":\"If you are a Java developer, chances are you have at least some experience with other programming languages. Some of us started their programming adventure with another language like C\\\/C++, JavaScript, C#, Python or maybe even something like Pascal or Basic. Some, though, started with Java and just never paid too much attention to other languages, unpleasantly remembering the one time when they needed to quickly code something on the frontend side.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/#breadcrumb\"},\"inLanguage\":\"is\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"is\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why Kotlin is awesome, but you will stay with Java anyway\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"is\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"is\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"is\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/is\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Af hverju Kotlin er fr\u00e1b\u00e6rt, en \u00fe\u00fa munt samt sem \u00e1\u00f0ur vera \u00e1fram me\u00f0 Java - The Codest","description":"Ef \u00fe\u00fa ert Java-\u00fer\u00f3unara\u00f0ili, er l\u00edklegt a\u00f0 \u00fe\u00fa hafir a\u00f0 minnsta kosti einhverja reynslu af \u00f6\u00f0rum forritunarm\u00e1lum. Sumir okkar h\u00f3fu forritunar\u00e6vint\u00fdri\u00f0 sitt me\u00f0 \u00f6\u00f0ru forritunarm\u00e1li eins og C\/C++, JavaScript, C#, Python e\u00f0a jafnvel eitthva\u00f0 eins og Pascal e\u00f0a Basic. Sumir byrju\u00f0u hins vegar me\u00f0 Java og hafa einfaldlega ekki veitt \u00f6\u00f0rum forritunarm\u00e1lum mikla athygli, me\u00f0 \u00f3\u00fe\u00e6gilegri minningu um eina tiltekna atbur\u00f0ar\u00e1s \u00feegar \u00feeir \u00feurftu a\u00f0 k\u00f3\u00f0a eitthva\u00f0 flj\u00f3tt \u00e1 fronthli\u00f0inni.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/is\/blogg\/af-hverju-kotlin-er-aedislegt-en-thu-munt-samt-sem-adur-vera-afram-med-java-1\/","og_locale":"is_IS","og_type":"article","og_title":"Why Kotlin is awesome, but you will stay with Java anyway","og_description":"If you are a Java developer, chances are you have at least some experience with other programming languages. Some of us started their programming adventure with another language like C\/C++, JavaScript, C#, Python or maybe even something like Pascal or Basic. Some, though, started with Java and just never paid too much attention to other languages, unpleasantly remembering the one time when they needed to quickly code something on the frontend side.","og_url":"https:\/\/thecodest.co\/is\/blogg\/af-hverju-kotlin-er-aedislegt-en-thu-munt-samt-sem-adur-vera-afram-med-java-1\/","og_site_name":"The Codest","article_published_time":"2022-05-18T10:39:02+00:00","article_modified_time":"2026-04-28T14:07:11+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png","type":"image\/png"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Why Kotlin is awesome, but you will stay with Java anyway","datePublished":"2022-05-18T10:39:02+00:00","dateModified":"2026-04-28T14:07:11+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/"},"wordCount":1973,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png","articleSection":["Software Development"],"inLanguage":"is","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/","url":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/","name":"Af hverju Kotlin er fr\u00e1b\u00e6rt, en \u00fe\u00fa munt samt sem \u00e1\u00f0ur vera \u00e1fram me\u00f0 Java - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png","datePublished":"2022-05-18T10:39:02+00:00","dateModified":"2026-04-28T14:07:11+00:00","description":"Ef \u00fe\u00fa ert Java-\u00fer\u00f3unara\u00f0ili, er l\u00edklegt a\u00f0 \u00fe\u00fa hafir a\u00f0 minnsta kosti einhverja reynslu af \u00f6\u00f0rum forritunarm\u00e1lum. Sumir okkar h\u00f3fu forritunar\u00e6vint\u00fdri\u00f0 sitt me\u00f0 \u00f6\u00f0ru forritunarm\u00e1li eins og C\/C++, JavaScript, C#, Python e\u00f0a jafnvel eitthva\u00f0 eins og Pascal e\u00f0a Basic. Sumir byrju\u00f0u hins vegar me\u00f0 Java og hafa einfaldlega ekki veitt \u00f6\u00f0rum forritunarm\u00e1lum mikla athygli, me\u00f0 \u00f3\u00fe\u00e6gilegri minningu um eina tiltekna atbur\u00f0ar\u00e1s \u00feegar \u00feeir \u00feurftu a\u00f0 k\u00f3\u00f0a eitthva\u00f0 flj\u00f3tt \u00e1 fronthli\u00f0inni.","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/#breadcrumb"},"inLanguage":"is","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/"]}]},{"@type":"ImageObject","inLanguage":"is","@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/why_kotlin_is_awesome-_but_you_will_stay_with_java_anyway.png","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/why-kotlin-is-awesome-but-you-will-stay-with-java-anyway-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Why Kotlin is awesome, but you will stay with Java anyway"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"is"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"is","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"is","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/is\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/comments?post=3913"}],"version-history":[{"count":8,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3913\/revisions"}],"predecessor-version":[{"id":8525,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/posts\/3913\/revisions\/8525"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/media\/3914"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/media?parent=3913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/categories?post=3913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/is\/wp-json\/wp\/v2\/tags?post=3913"}],"curies":[{"name":"vp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}