Kotlin's better than Java? Or vice versa? Let's find out...
Вставка
- Опубліковано 6 лип 2024
- Kotlin is expected by many to kill Java. So is it true? Let’s find out.
▶ Contact Jelvix: hello@jelvix.com | jelvix.com
We are a technology consulting and software development company eager to share our knowledge and experience.
Subscribe for more tech tips and tutorials: / @jelvix
▶ LINKS:
- Java vs .Net - jelvix.com/blog/java-vs-net-c...
▶ TIME CODES:
00:00 Kotlin review
01:32 Java for Android development
02:41 Differences: Java vs Kotlin
05:11 Contact Jelvix
▶ Follow us:
Facebook - / jelvixcompany
Twitter - / jelvix
Instagram - / jelvix
Linkedin - / jelvix
Upwork - www.upwork.com/ag/jelvix/
▶ About this video:
For Android development, we use Java 7 as default, while Java 8 version has been supported natively since Android SDK 26. Keep this in mind.
Java is an object-oriented, multi-platform programming language. Kotlin is an open-source, general-purpose programming language. Let’s compare them. - Наука та технологія
Do you expect Kotlin to replace Java so soon? Let's discuss whether this claim holds true...🫡
2:22 : "Java is verbose and requires more lines of code!"
*shows XML*
@@jappleng8283 I understand where you're coming from, and I have less experience than you (still quite a bit though, Java has been my main programming language for a few years now), but I think you're underestimating Kotlin. While Java's syntax is certainly familiar, it's very rigid and repetitive. Kotlin implements more modern syntax features that deviate from the traditional c-style, and tbh I kinda dig it. Ofc both languages compile to the same bytecode so this isn't really a huge deal, plus any library written in Kotlin is backwards compatible with Java and vice versa, so like you said it's really just a preference thing.
Android development certainly is comically messy though lol, and Google's lack of any semblance of support for developers is downright astonishing.
@@jappleng8283 I think what they ment by unsecure and secure is that
In java, public variable are unsecured and it's why we just do a private variable with getter and setter, it makes it safe
In Kotlin however, a public variable is in reality a java private variable with getter and setter included, this is safer since you can never have unsecure public values (also no identifier just turns it public by default)
Kotlin's protected changes the variable's getter/setter method to be protected and private just creates none
So Java is safe, Kotlin is safer, that's what they ment, but this channel seems like they know nothing since they showed an XML file instead of Java code which is idiotic cause Kotlin would also use the very same XML file
Also, Java isn't slow by any means unless you compare it to C or C++ ... just uses lots of memory.
@@TBiscuit1 for the getters and setters, you could always use lombok to get the same safety and conciseness
@@lewisayers5983 Yeah that thing is great!
-you can extend a class funtionality in Java.
-the code isn't complex or longer from using getter or setters. That's encapsulation, and you can do it in Kotlin too. It's not a language feature but a methodology of OOP.
-then It rants about java being verbose and longer for writting than Kotlin. but shows a manifest xml file. That you also would have to use in Kotlin.
"you can extend a class functionality in Java"
You can only create static functions or subclasses in Java. With Kotlin you can write extension functions directly on an existing class, which comes in handy in numerous places where subclassing would be cumbersome (perhaps special functionality on the Android TextView).
The last point about the verbosity is true. I caught that in the video too and when I saw XML it gave me a good laugh.
@@zacharylippard2994 subclases. Yes. It ain't cumbersome. But yes. I get it. In kotlin is even easier to extend it on the spot.
He also mention verbosity which actually turns out to be healthier for my brain than I expected.
He also mention performance, like, is Java slower than Kotlin?
Dude 4:49
I so know right? He showed cons of java then said Kotlin is easier and didnt show any how or why.
Bruh,
The fight between Google and Oracle, and especially Google's ego towards Oracle has led to slow adoption of new Java LTS versions in Android. If JDK 17 is done today, it will be awesome to write Java code.
As regards to KOTLIN, I am Java developer, I love Java programming very much. And I am learning Kotlin for quite few weeks. I think rather than Java vs Kotlin, Java + Kotlin is really damn powerful than any combo. The best of both worlds in every project is a guarantee of success. Also, I am liking Kotlin and its style of writing code. But not at the cost of Java, but alongside Java.
I would say a Java developer should learn Kotlin, and vice-versa. It will give them the most powerful tools to write and develop.
Absolutely! Learning both Java and Kotlin gives you a powerful toolkit for development. Their combination offers the best of both worlds, enhancing flexibility and efficiency in projects. Happy coding!
Good video! What's your thought about flutter for mobile development ?
Kotilin is just child of legal issues between Oracle and Google and Java source code. I don't see any benefits using Kotlin over Java. Maybe some things u can write in less code. Compose is disaster for complex ui. (My personal experience)
As a beginner I wanna know which language to pursue
3:40 in newer versions of java you can do "if(object instanceof String string) {return string.length();}". Little alternative
I think that kotlin was made to replace java
Thanks for video. What language is better to start from, bearing in mind that I’m null in programming?
C because then you will understand pointers really well which can be something difficult to grasp if you start out with python
Definitely give Kotlin a try. I'm having fun learning Kotlin on JetBrains (the developer behind Kotlin) as my first programming language and about to complete my third project in less than a month in. I tried to learn C++ and Java in the past and struggled.
@@nilebrixton8436 java vs kotlin vs dart which is best for starting app development ?
Great video! It's interesting with how far behind Android is when it comes to Java. Only just recently had it supported JDK 11. This is probably another reason as to why Kotlin is preferred by Google. It provides more powerful language features SOONER than Java even though later versions of Java now support similar things (lambdas for example).
By the time Java will get some features then Kotlin will get new features. It will always be ahead...
The best part of Java is the JVM. Compiling Java to native code with GraalVM is just awesome.
Yes like Kotlin !
We are currently learning Android development using Kotlin at my college!
Great
Thanks for the video. FYI the narration mispronounce many cs terms
I'm trainee in mobile application development for Android and this is the most helpful video I've seen in the past month.
Simple and to the point! Thanks
Nicely explained how reading the code is important
Could show examples on each topic.
this is like bot-made video
background music too loud. But thanks anyway.
but wait a minute, these are just syntactic changes, i dont understand, you are still dealing with the jvm and related classes, right?
You need to remember that on Android, a compiler is needed to convert kotlin code to a Java code, so no, Java won't go.
That makes sense to me 🗿
what do you mean Java wont go?
So for android, which is prefered java or kotlin?
@@novianindy887 Kotlin is based on Java, that means without Java, there will be no Kotlin
@@AhmadNasriya That's not true. Kotlin is not *based* on Java, it can be compiled into byte-code that runs on the Java Virtual Machine and is interoperable with existing Java libraries. Applications built for Android must be be compiled to byte-code to run on the Android Runtime environment, that, although similar in function to JVM, IS NOT THE SAME!
no.. its not trasnpile to java code at all..its transpile to bytecode.. nothing related to java at all.. since java code also transpile to byte code..so do groovy, scala, jython and slew of others.. java is not needed.. jvm is the only thing its needed
so, kotlin lacks in performance like java?
Good day👋!
If you use Kotlin with JVM as a target to run applications, then yes.
But Kotlin can be used to write programs with compiling to JavaScript or Native. And these cases ver different from JVM target
have you heard about Lombok? With this plugin dependency, you dont need getter setter or Constructors in Java classes, it's quite handy !
I've done many languages and when he said "Java is easy to learn", I almost had a heart attack.....I some how pick other languages so fast...but java, NO
For a c++ developer, learning Java is the simplest thing. However, Java developers will have a steep learning curve to write code in cpp
I started with C++ and then Java. If u started with those 2 languages, no other language can be difficult to learn.
@@AminAramoon so true once you learned c++ , java is literally a breath of fresh air
if Java is hard for you, then which language is easier to learn? name it, please :) and what exactly was easier?
Started with python for a few weeks, until i heard about java really hard and whatever
And when i got my hand on java
Im shocked, cuz in my eyes java is just a python with longer syntax
high quality content 🔥🔥🔥
Kotlin: Code conciness!
Java: Did you heard about Lombok?
And so on...
@Miracle oh, man. Many interesting things are waiting you :)
For beginning: "Java" is not only island and kind of tea.
how to spot an inexperienced programmer
4:48 "Data Class" is a "smell code" (Martin Fowler - Refactoring), it produces a non-cohesive class. Both exaples "smells" but i see a pro in java, if the "smell code" is textual you can recognize it better.
Also, i think the type sistem is your friend. Gives you control and security in your desing and development process. :)
Less code is always better, and anything missing from a new language is usually implemented over time. I really hope Kotlin removes the Javascape from existence for anything but legacy.
At 2:23, that's XML not Java. :)
We’re so happy to hear from you! Thank you for your valuable feedback. 💗
for those complaining, java is really easy to learn, you learn about OOP and advanced concepts in a really easy and high level way. if you start with somethig like python it'll be harder to learn other languages and you'll lack many things
Thank's
One of the biggest eCommerce in Europe is written mostly in Kotlin nad Java. ( about 1000 microservices in Kotlin )
JIT can optimize Java code much better than static compilers
I was honestly appreciate UA-cam algorithm, that I find this video!
Great video!
Would help to explain the usual pronunciation of words in the context of code (e.g. "record", which was pronounced like in "I'll _record_ something" instead of like in "a music _record_").
I think saying it in the correct way makes developers feel more at home.
Edit: Just by looking at your content both here and your page anyone can see the attention to every detail, great job!
Slava Ukraini
I'd be surprised if the speaker isn't just reading from a script and has any idea of what he's talking about. They'll often say a simple word when it would have been an easy place to elaborate on what it means, e.g. "in Kotlin, it's a lot easier" 🔚, "that is coroutines" 🔚. Or they emphasize the wrong word: "it *is* considered an object". Or pronounce the word wrong like how they said "inference" like "interference" just without the "ter"
it's text to speech...
Those drawbacks aren’t even drawbacks! So you actually didn’t even find any drawbacks of Kotlin. Pure facts!
Swiggy Deiliverh App made by Konltin
Perfectly explained and exactly what I needed.
Java is very good to build up OOP knowledge (don't blame NPE, that means your design has flaws), Kotlin has some handy features (like coroutines and data class as mentioned in the video), that is fun to write but confusing to read sometimes.
Lol we all know that NPE is a developers mistake but it is called a million dollar mistake for a reason if Kotlin can solve this thing to an extent by giving compile time errors then it's a win situation for the developers .
Plus your comment sounds idiotic when you are saying Kotlin is confusing in terms of readability. Kotlin is not confusing it's you who are struck with java long syntax that you can't understand the readability and conciseness of Kotlin Syntax.
The Kotlin code is clean and readable at the same time...
Kotlin is the Future
What about flutter?
@@gboy6120 Nope
@@gboy6120 I think dart sucks
@@gboy6120 Flutter is for baby programmer but it could be better in the future, and now it's not a native language lol
@@TriNguyen-ym3hf + poor performance over native (java or kotlin) on android.
Mmm I really like verbosity lenguages :D
Me too... I can read and understand the damn thing months later.
Another well explained video. Currently I use Java since I have not learned Kotlin
Hi man, I just started learning, do u recommend me Java or Kotlin ? Thanks
@@oheil5694
Kotlin because java is no longer supported by google
@@davidthewise6617hi sir. In my country VietNam, i consider that the job for Kotlin is quite little. So which one is better to start? Java or Kotlin?
Null Safety can be dealt with by using Optionals and with the var keyword you can infer variable types
If Java goes away, so goeth I: Back to Visual Studio with MFC and my Android devices get acid bathed.
... Kotlin can also use Java libraries
1:50. Java is easy to learn as it has a simple syntax. Said the guy who invented the Chinese language.
Java? Easy to learn? Dude wtf mostl people hate (or are scared of) Java due his sintax
We love hearing from you! Thank you for leaving feedback for us. 🤓
Yes, pretty easy. Compare to C/C++ where Java was inspired from!
C/C++ has pointers (Java doesnt), multiple inheritance (Java doesnt), lack of dynamic memory allocation (Java doesnt), lack of automatic garbage collector (Java doesnt)... And you say that Java isnt easy?! C'mon!
Yes and C/C++ it's easier than assembly... of course. And python it's easier than java@@lucaspiano
Koltin is too slow to compile. It feels like a 80's compiler.
you say that java is easy to learn? I`m crying with JS xD
Kotlin is just marketing of JAVA forever
java
I learned about Kotlin through minecraft mods
Best way to learn, to be honest! Why still don't we have programming schools in minecraft?🤔
In Android app development, JAVA is dead and replaced by Kotlin.
That is Fact !
Java easy to learn lol 😆 , it's sometimes Chinese food hhh
2:25 XML verbosity attributed to the Java language makes this video immediately irrelevant
Hmm might be biased
not over the kotlin . JAVA is the untold king over all the programming language.
Java is easy to what???
Biggest downside of Kotlin is if you speak German, it sounds like the name means "puke language".
😉
Man's just a Java fan.
Java is my second programming language, I learned it in school, but never really liked it
Kotlin compiled into Java, and just can’t kill himself.
I looked at kotlin. Its nonsense, mutilating flexibility of a language to call it "FRIENDLY" is dumb as dumb can get. There is language and there is platform library. Trying to merge a library into a language is not how you design a language. For example Java not having universal generics is a language problem. But solving it by removing primitives like kotlin did is plain dumb. Java is atleast addressing this limitation in project Valhalla hopefully in a year. removing all limitations of a language.
Where java needed more features like value objects.. which can be added in time. Kotlin took the approach of having feature you wish to remove from a language. which cannot be done.
Java supports RECORDS. Just because Android doesn't support java RECORD and Kotlin automatically generates the boilerplate code, is it a problem of Java or Android? And since Android ecosystem is a Google's child, same as the choice of Kotlin being default language in AndoridStudio, then doesn't it look like there is artificial fight with java by not implementing the higher versions and features of java properly? Someone wants to have monopol over the whole Android, and that's where kotlin kicks in. Java is also very concise, especially newer versions. You say java java don't have automatic type inference, well maybe on Android it is another feature that is fighted with, but java has "var" since long time now, funny that in 2022 you still enumerate it as a Kotlin advantage over java. And you said that java is not secure, and that Kotlin can laverage the libraries of java becuases uses JVM - this implies that Kotlin can't be more secure than java. And the point about java allowing "null", well, to me it is very unwise to point this as any advantage or disadvantage of one language over another - this whole "null" thing is artficial problem of people not understanding the languge, the null thing can't really be reasonably opted out, every solution to this introduces additional level of complication, because in Object Oriented programming the concept that the referenced object is not existing which is the concept of "null" is like the concept of "zero" in math is part of the world, and so we should have Optional for zero, because dividing by 0 can cause RuntimeException? No, imagine the readablity of code checking before every divison - that would be a mess and a bugs cradle - the program needs to be designed that where there can't be zero, there is no zero, and where there can't be null, there is no null, the programmer is responsible (proper code, proper tests, documentation etc...). In java you have the Optional type where you can return some object instead of null, but I never saw a scientifically conducted examination stating that the lack of null in language is better than having it, especially to prove that it improves code readability, lowers the bugs rate etc, actually what I've found is the the more complex the code, the more fancy ideas there is more bugs, and that's it. KISS
Sound null safety is actually important in production. Don't kid yourself
The video implicitly compare java for android to kotlin and not newer version of java. So your comment is unnecessarily long.
wait a minute did u just say -"java easy to learn" !!!!!!!!!!!!!!!!!!!!!!!! dude are u alright??
Who taught this narrator how to speak English?
Something was unclear in video? Please, specify what exactly, so we can upgrade our vocabulary or accent in further videos!
@@Jelvix Many words were pronounced incorrectly.
There’s nothing wrong with your English, this is just a hater
Kotlin won't replace Java because it has to be compiled into java
Kotlin is fun
We appreciate you sending us your feedback. 😉
@@Jelvix Ye I learned Kotlin cause I felt like making minecraft mods in another language to be honest. Thanks to ShadowFacts, that's possible using their API.
Is this some sort of AI narrating? Core-atines? infur-ance?
I hate Jave... More than sand.
Java is far more better then kotlin. Google just made kotlin as official language because of the partnership with jetbrain (Inventor of kotlin and Android studio)
Well to be honest i rly like Kotlin 😁Its very simple but powerful 👍
@@baphomet8958 I agree that it is simpler then java, but still it lacks in many areas. Specially in frameworks and community
@@androdeveloper7261 weird statement considering you can literally run any java library/framework in kotlin
@@kanmeo Yes it can. I meant that programmer still choose java for writing frameworks because of the compatibility that you started above
Java is dead mate
Is this AI voice? I don't like it 👎👎