Is C# Better than Java?

  Рет қаралды 17,611

Gavin Lon

Gavin Lon

Күн бұрын

Пікірлер: 195
@battletremor
@battletremor Жыл бұрын
I have just started programming in c#, It was very easy to learn and I could put my logic into code effortlessly. So c# is a better choice for me, this video helped me understand more about c#, great work 💯
@GavinLon
@GavinLon Жыл бұрын
It's my pleasure. I'm really happy that this video has been helpful to you :)
@aweklin
@aweklin Жыл бұрын
The differences are the reason I stick with C#. Though, I started with Java but more mouth watering features of C# made me stick to it. C# wins almost everywhere if objectively compared.
@GavinLon
@GavinLon Жыл бұрын
I totally agree! C# wins for me too! Thank you for your comment! :)
@femidaniel
@femidaniel Жыл бұрын
My Experience,we once had an airtime vending project built with Java and deployed on wildfly,,@ peak demand periods it would suddenly freeze daily,when we moved over to another one built with C#, i took time to note we only restarted that application twice in a whole year,i have a great Java Dev as a friend too,but Microsoft with DotnetCore and now Blazor will always be my preferred choice and serious wide margins,Thanks for the detailed post,great work.
@GavinLon
@GavinLon Жыл бұрын
You are very welcome! Thanks so much for sharing your experience with both Java and C#/.NET. I will certainly not be moving over to Java any time soon. I'm very happy sticking with .NET and C# :)
@MegaJohn144
@MegaJohn144 Жыл бұрын
I programmed in Java for about 10 years, but I never fully got it. Java and all its tools seemed clumsy and disjoint. After retiring, I taught myself C# and Python, and I much prefer them. I cut my teeth on C and C++, so it is a natural choice.
@GavinLon
@GavinLon Жыл бұрын
Yes exactly, why make life harder than it needs to be? :) Python and C# are so much easier to learn and apply in my humble opinion. My first language was C - definitely a great first language.
@LE8271
@LE8271 Жыл бұрын
I believe one aspect is missing from the summary. It is the fact that .net core was created containers and Internet in mind. When it comes to containerization it just kills Java hands-down. Look at the size and the performance of a Java based container that tells everything.
@GavinLon
@GavinLon Жыл бұрын
Great, yes that is a useful addition - thank you!
@Anbu_Sampath
@Anbu_Sampath Жыл бұрын
C# has nice language features when compare to Java, but C#/.NET mutliplatform target came bit late when compare Java/JVM. Now unified .NET is big move and attract more devs.
@GavinLon
@GavinLon Жыл бұрын
Yes, I totally agree with that!! Java is way ahead at the moment, because (as you have stated, C# and .NET have only fairly recently become cross platform and unified) but the gap is closing :) C# and .NET is becoming more and more popular!
@nickbarton3191
@nickbarton3191 8 ай бұрын
And C# now has extensive FP support, I predict that it'll take over Java's 3rd spot.
@hammeedabdo.82
@hammeedabdo.82 Жыл бұрын
My personal opinion is that C# is better, and it should be ranked after Python and JavaScript. However, I don't know why I always see Java ranked before C#?
@GavinLon
@GavinLon Жыл бұрын
I honestly and objectively cannot think of a better programming language than C#. I also like Python and JavaScript, they certainly have their place but Java could probably be seen as the most similar language to C#, and in my humble opinion C# wins hands down! :)
@igorthelight
@igorthelight 2 ай бұрын
They are ranked by popularity - not on how good they are. Typescript is better than JavaScript but it's rated lower ;-)
@michel_dutch
@michel_dutch 3 ай бұрын
The best language is the one that pays the bills. In my case, that would be Java.
@GavinLon
@GavinLon 3 ай бұрын
I totally agree with you! Definitely pay the bills as first priority :)
@michel_dutch
@michel_dutch 2 ай бұрын
@@GavinLon I'd like to add that I do appreciate C# in that it provides an incentive for Java to improve, the same way that Groovy and Kotlin did. Java is becoming an awesome language. Well, at least if you started with Java 6, that is. 😊
@lufenmartofilia5804
@lufenmartofilia5804 17 күн бұрын
Well that is how I ended up with java too but to be fair java or c#, you can't go wrong with any of them 😁
@lufenmartofilia5804
@lufenmartofilia5804 17 күн бұрын
I code in both in a daily basis and I prefere personally java. The reason is the ecosystem, the language doesn't bloat with keywords and hide logic from the user. Java is straightforward easy to read, verbose (which is a good thing imho, as it make crystal clear what is happening). Further more a lot of important/ highly reliable tech I work with (Kafka, hivemq, apache beam, elastic search etc) was buildt in java with java in mind. While they do sometimes do have a c# client, they mostly feel like a second hand citizen. Furthermore, c# dependency often require some form payment (example if you need to do an advanced ETL pipeline that require to process a big amount of data, you end up using efficient data format like .avro.) while c# can work with it, free libs they have are far from as good as java. Not to mention virtual threads that is a god sent. Now everything is not pretty on java side too. Java is basically only usefull for backend / embedded environment which make it a very specialized language and not as versatile as C# that does : gaming, backend, frontend, desktop app etc. An other thing is that migrating legacy java (java 8) to modern java (21+) is a pain in the ass. Too much jobs require to work still on java 8 because of the migration problem / cost. Also java mentality in general is all about being functional and stable and less about rushing behind the new flashy trend or methodology that get popularity outside (95% of case) of the real world usage. This can be a plus or a con based on the envirronment. But usually this can be solved by basically using kotlin.
@GavinLon
@GavinLon 17 күн бұрын
Thanks so much for this detailed feedback! :)
@Ewig_Luftenglanz
@Ewig_Luftenglanz 7 ай бұрын
C# as a language is more flexible and we may say "better" than Java. But Java has a far better, bigger and open ecosystem and multiplatform support. With C# you are basically traped in a golden cage made and controlled by Microsoft, I know the latest versions of .NET framework (.Net core) has multiplatform support but it came very late AND the multiplatform support it's incomplete (no win forms for Linux for example) also the nature of .NET in the past and all the legacy applications have made that basically 95% of C# development is focused on windows. Nothing wrong with that, but if you are not interested in windows development (both server and desktop) real world C# development will mostly target Microsoft and azure and that's a limitation.
@GavinLon
@GavinLon 7 ай бұрын
Awesome! Thank you! It's great to get a fairly detailed comment from the Java perspective! :)
@adikztv6371
@adikztv6371 10 ай бұрын
It isn't 100% fair to say that the difference between Java and c# is that you can Write frontend in c#. In java you can do it as well. If you want to make such notion then you'd Rather have to compare These technologies instead of saying that Java lacks it
@GavinLon
@GavinLon 10 ай бұрын
Okay - thanks for your feedback :)
@kaihusravnajmiddinov5413
@kaihusravnajmiddinov5413 5 ай бұрын
How you do it in java ? Of course I know you can write WASM compiler from scratch, or java-to-javascript compiler. But is there anything ready for that ?
@adikztv6371
@adikztv6371 5 ай бұрын
@@kaihusravnajmiddinov5413 you can do JSP (probably not a good idea as it's a bit old technology) or you can use thymeleaf.
@dennycrane2938
@dennycrane2938 Ай бұрын
​@@adikztv6371 lo.. So your argument is that you CAN do it, ... you just have to time travel back to 1999 or 2011 to do it. There's also more to frontend than web. What are the desktop options and when were they last updated/evolved? yikes
@stelios.a
@stelios.a 29 күн бұрын
The choice of collaboration among developers severely underrates partial classes. You can use them to "extend" code generated from a source generator without messing up with the source generator itself. Try it and you will see what I mean. :)
@tanakamichael-dp1nb
@tanakamichael-dp1nb Жыл бұрын
Java was my 2nd first programming language. Used it quite a bit until I started to hate it, then I switched to JavaScript with mostly Angular. Later on, I picked up on how some startups are combining Angular and .NET to create performant solutions. So, I embarked on a journey to learn C# language basics early this year. One thing I'm certain of is I'm staying with C# and .NET. Definitely it's better than Java.
@GavinLon
@GavinLon Жыл бұрын
Thanks for this interesting comment! Yes, it's also quite convenient that .NET provides Angular and React project templates to make it easy to combine relevant front-end SPA frameworks with .NET and C# on the backend. :)
@vijayansivaraman7923
@vijayansivaraman7923 11 ай бұрын
C# wins over java. Great video on the planet to showcase the pros and cons of c# and java. Kudos to your hard work and efforts.
@GavinLon
@GavinLon 11 ай бұрын
Thank you for your very kind comment! It is greatly appreciated :)
@ryanobray1
@ryanobray1 Жыл бұрын
I wish that C# would include the ability to add properties to enums like Java, but that's pretty much where it ends for me. Perhaps my biggest turn off with Java is that Oracle is the language steward. I also VERY much prefer Visual Studio over IntelliJ and Eclipse AND not having to deal with pom files.
@GavinLon
@GavinLon Жыл бұрын
Thanks for this interesting comment. Visual Studio definitely makes life a lot easier. I wonder if Microsoft will add properties to enums in a future version of .NET - might happen :)
@julianjupiter5890
@julianjupiter5890 Жыл бұрын
Oracle may be a bad company in general. But we should not judge by that optic as far as Oracle being steward of Java is concerned. Oracle turns out way better steward of Java. Those who observe objectively do recognize Oracle being good steward.
@dotnetforever
@dotnetforever Жыл бұрын
"Properties to enum"... Are u okay? That it wont be an enum.
@julianjupiter5890
@julianjupiter5890 10 ай бұрын
The good thing with build system like Maven (pom.xml) is you don’t need IDE to build our app.
@kaihusravnajmiddinov5413
@kaihusravnajmiddinov5413 5 ай бұрын
@@julianjupiter5890 honestly speaking, oracle is not even close to Microsoft in terms of product development culture and enthusiasm. I think oracle lacks scientists. By other words real smart people in managerial positions. I am sure many smart people work in oracle, but those are probably not in decision making positions.
@slr150
@slr150 Жыл бұрын
Java is more careful about introducing new syntax than C#. C# may not be very attractive in the moment, but in the long run you get a more stable language in Java. A good example is Java victual threads, it was carefully designed to make sure that functions are colorless, where c# is still stuck with colored functions and await/async. The trouble with having new syntax catering every new fad is that when it goes out of fashion you are left with language bloat. C++. is another example of language bloat going badly .
@GavinLon
@GavinLon Жыл бұрын
I like your point about syntax. It is far more important to learn programming principles and fundamentals - code sugar can be good but it should not be a priority, as you say to follow every fad that comes along :)
@dotnetforever
@dotnetforever Жыл бұрын
What is the new systax is really bad in c# added in the latest releases?
@slr150
@slr150 Жыл бұрын
​ @DmitryBaranovskiyMrBaranovskyi The trouble is not with "new syntax" , it is when "new syntax" eventually becomes old syntax and goes out of fashion. I already gave you an example with sync/wait (these color your functions). Java accomplished the same thing as async/await without introducing a single keyword or having a color limitations on function calls (Lookup project loop/virtual threads). Although I think Java is better than C# when it comes to unnecessary features, it still has some historical baggage. I would personally pick Go instead of Java/C# for new projects. Go has minimal syntax, had virtual (green) threads from the start, avoids multiple ways of doing the same thing, and is relatively fast compared to C#/Java.
@paulpach
@paulpach 7 ай бұрын
I work in Java most days at work. It is an ok language. Libraries like spring boot help make it more palatable. Then I go home and work on my own projects in C#. So if I have the choice, I will choose C# for many of the reasons you listed.
@GavinLon
@GavinLon 7 ай бұрын
It's great to get comments like yours that are based on personal experience with the relevant languages. Thank you for your comment :)
@himanshutripathi7441
@himanshutripathi7441 4 ай бұрын
Dck cbippllledsreEE😂🎉😂El​@@GavinLon
@igorthelight
@igorthelight 2 ай бұрын
A few additional interesting things about C#: * It has a "dymanic" type which is the same as in Python - a dynamic type! It's slow but you can do things like that: dynamic my_var = 10; my_var = "hello"; * Since .NET 8 you could compile application to a native binary! It will have a Garbage Collector with it but you would not need .NET installed on the system! And also it works faster and uses less memory!
@marcus31425
@marcus31425 6 ай бұрын
Whatever language I use, I always miss at least one feature that C# has
@jaymartinez311
@jaymartinez311 7 ай бұрын
Started with C++, then python and then Java. Left all of that behind once i started using typescript. Got a job in Vuejs saw i was dealing with many api fetches & changing the data for my use case once fetched, so i started learning back end. Tried typescript blah. Java was a mess for it. Golang was great but didn’t have enough stuff built in. Rust was fun but without a framework i couldn’t learn how to use lifetimes but polonius might fix that soon. Then i finally tried C# seriously with their ugly bracket placements 😂. I love it. Dotnet 8/C# 12 is like a typed typescript. It’s my favorite language. The brackets i use K&R code style meaning them brackets are with the signature on the same line 😜. I usually use a big O notation project to learn a language & hands down C# was flawless in creating such a project. inline object creation with new = { } is one of the many js/ts type coding i love C# for. Though Java & C# look alike from far away C# is a much bigger language & much much better to develop in and the cli is awesome 😎
@GavinLon
@GavinLon 7 ай бұрын
Wow - thank you for this well thought out comment! I really enjoyed reading it and I totally agree with you on everything you said about C#! It's definitely my favourite language too! :)
@jaymartinez311
@jaymartinez311 7 ай бұрын
@@GavinLon Only frustration is i’m 41, just got my CS degree but Jr roles (real ones) are non-existent anymore. I love this stuff but i guess i’ll just build something with a dotnet backend with vuejs or if im lazy webflow for the frontend 😂🫡
@GavinLon
@GavinLon 7 ай бұрын
You'll get a job. Just keep going and keep building. My advice is build something awesome and get it into a GitHub repository - so that you can show potential employers what you are capable of creating. Don't worry about your age - 41 is pretty young these days anyway. Just keep going - you certainly have great enthusiasm and seem to love coding - that is very important! :)
@jaymartinez311
@jaymartinez311 7 ай бұрын
@@GavinLon Thank you for the kind words.
@marko5734
@marko5734 Жыл бұрын
Great video as always
@GavinLon
@GavinLon Жыл бұрын
Thank you very much! :)
@H4KnSL4K
@H4KnSL4K 5 ай бұрын
Have you tried to install .Net core SDK on Linux? The instructions have so many caveats and only the latest version is supported (well, it depends...) and many ways to install it . And different problems with different choices... Java is not perfect, but it is much better supported
@GavinLon
@GavinLon 5 ай бұрын
Great to get push back from the other side. Thank you for your comment. I'll look at .NET on Linux at some point - that will make for an interesting video topic. Java is a great technology, but on the whole I just prefer .NET.
@RedbeardyMcGee
@RedbeardyMcGee Жыл бұрын
did you generate this video script with chatgpt 1.0
@GavinLon
@GavinLon Жыл бұрын
No - I never use AI in my videos.
@cissemy
@cissemy Жыл бұрын
Thanks Can you make one about CSharp vs python ?
@GavinLon
@GavinLon Жыл бұрын
I've already done that. :) Please check out the video here - kzbin.info/www/bejne/eoirYYdrl7Bsoac
@nestormartinez9259
@nestormartinez9259 10 ай бұрын
In fact C# it's cool lenguage but here where I live Java came with a better salary and also it's more used, althought maybe this could be change soon. I belive not in a way where java would be replace but in way where both of them compete more directly in fields where Java is well adpted like banks and other enterprise aplications.
@GavinLon
@GavinLon 10 ай бұрын
Yes, Java is still more widely used than C# in general, but that gap is getting narrower. Java is certainly a great technology but I prefer .NET and C#. The great thing about these two languages is that if you know object oriented principles and you are skilled in one of these two languages, it is relatively easy to learning the other language (because they are very similar in many ways).
@wakeelsaliu5190
@wakeelsaliu5190 Жыл бұрын
C#. It's faster, and knowing only C# is enough to be a fullstack developer and also build both your mobile and desktop apps with it.
@GavinLon
@GavinLon Жыл бұрын
Yes, those two points certainly make C# sound like a great choice over Java. :)
@potatoml4631
@potatoml4631 Жыл бұрын
C# but im using Java for work
@GavinLon
@GavinLon Жыл бұрын
Java is an awesome technology but I much prefer C# and .NET. Nothing wrong with Java at all in my humble opinion.
@christopherwilliams3293
@christopherwilliams3293 Жыл бұрын
I'm in the same both. I do admit that IntelliJ is better than Rider, but Jetbrains does allocate a lot of resources to Rider still. I wish Rider had search structurally and the rich debugging features like IntelliJ. However, Rider team is very busy keeping up with the .NET technologies.
@kaihusravnajmiddinov5413
@kaihusravnajmiddinov5413 5 ай бұрын
You work sucks 😂 (joke)
@diadetediotedio6918
@diadetediotedio6918 7 ай бұрын
I prefer Kotlin because the syntax is way nicer, but I love C# because it has a waaaaaaay better runtime with value types and type monomorphization, a Kotlin for .NET would be the best of both worlds.
@GavinLon
@GavinLon 7 ай бұрын
Thanks for your great comment. I must say I'm intrigued by Kotlin and would like to explore the language more. I like what you said about C#, .NET is an amazing runtime and I love the type system! It's definitely my favourite programming language.
@isnotnull
@isnotnull Жыл бұрын
Is Java still using get and set compared to properties in C#
@GavinLon
@GavinLon Жыл бұрын
This is how getter and setter properties are implemented in Java - www.geeksforgeeks.org/getter-and-setter-in-java/
@isnotnull
@isnotnull Жыл бұрын
@@GavinLon So still no auto properties. I learned Java in 2014, seems no progress since then
@GavinLon
@GavinLon Жыл бұрын
@isnotnull I don't think Java have auto implemented properties like in C# :)
@henryvaneyk3769
@henryvaneyk3769 Жыл бұрын
@@GavinLonAlmost no Java devs use get and set anymore. We all Lombok our properties.
@blueSurfer
@blueSurfer 11 ай бұрын
Java also has records . so we can only write a single line to create getters, setters, toString, hashcode. public record Employee(int id, String firstName, String lastName) {}
@TedFanat
@TedFanat 28 күн бұрын
There was a moment in my career when I worked on a project with C# and Java. It was .NET 4.6/C# 7(not sure) and Java 8. Java 8 came out only a year before C#7 but has absolutely NO CHANCE against it - Java is worse in all possible and impossible criteria. But I have no idea of how is modern Java compared to modern C#. Also, I heard Kotlin is also very nice, but yeah it's no Java, so it's a different story
@GavinLon
@GavinLon 28 күн бұрын
I definitely want to do a deep dive on this channel into Java and Kotlin. Thank you for sharing your experience and point of view :)
@lufenmartofilia5804
@lufenmartofilia5804 17 күн бұрын
Kotlin is java. You run on the jvm, you use java ecosystem, it compiles to bytecode and are fully interoperable
@randyriegel8553
@randyriegel8553 11 ай бұрын
I used Java a long time ago. Then I met up with C#... It had almost the same syntax the time but C# was like Java on steroids. Been a C# developer since 2005. My first job out of college I used plain C on a SCO Unix server. It's very funny now that the company I work for has many languages for different things... my biggest downfall is Python... I always have to search stuff up or ask the Python Guru at our company when working that stuff.
@GavinLon
@GavinLon 11 ай бұрын
Thanks so much for sharing your experience. C was actually the first language that I studied, VB6 was the language I used at my first job, then I moved to VB .NET and then C#..Most people seem to favour C# over Java - and I can certainly see why. Python is definitely worth learning, especially with the rapid evolution of AI! :)
@barkeldiho
@barkeldiho 6 ай бұрын
Who starts a video like that disqualifies himself immediately :D
@GavinLon
@GavinLon 6 ай бұрын
lol - just intended as a bit of fun :)
@dirkschannel5817
@dirkschannel5817 Жыл бұрын
Another great Video. I used both in my career. C# long felt like the better Java. For the defense of Java one should keep in mind that Java is a bit older than C#, so Microsoft could improve C# and add stuff like properties. Since C# can now be used on Linux systems, the main advantage of Java vanished.
@GavinLon
@GavinLon Жыл бұрын
C# has benefitted from being the younger language. Now that C# is cross platform, C# and .NET, in my humble opinion, is far better than Java.
@hugochavez6170
@hugochavez6170 Жыл бұрын
What do you mean with properties?
@dirkschannel5817
@dirkschannel5817 Жыл бұрын
@@GavinLon Do you know Dave Plummer’s channel? The result of the software drag race with implementation of the prime sieve algorithm regarding C# and Java was an interesting surprise. Would be interesting to see a rematch with .NET 8
@GavinLon
@GavinLon Жыл бұрын
@@dirkschannel5817 I'll check out Dave Plummer's channel. Thanks! It would be good to do a deep dive comparison between C# on .NET 8 and Java - its just finding the time to do all these things :)
@judewestburner
@judewestburner Ай бұрын
For me it entirely depends on the job I'm going for.
@fabricehategekimana5350
@fabricehategekimana5350 Жыл бұрын
Thank you for this informative video ! I am really proud to see the new iteration of C like C++, Java, C#, or Rust my preferences: 1. Rust 2. C# 3. C++ 4. Java Actually, I heard that Java is paid more because companies have a large code base of legacy code written in Java (too expensive to switch technologies) and some java devs are retiring so a java dev is a precious resource
@GavinLon
@GavinLon Жыл бұрын
Very good point about large Java code bases of legacy systems. So Rust is your number 1 - I hear it is a great language - I look forward to diving deep into Rust fairly soon! :)
@farrenh
@farrenh 11 ай бұрын
C# is wayyy better than Java in terms of language design. But also its runtime is better. Don't listen to people who've invested decades in Java when they tell you that performance and resource use are roughly similar and it depends on the application. It's just not true. .Net runtime is more performant and uses less resources. And it absolutely slaughters Java in high concurrency tasks (1 million+ equivalent concurrent tasks on the same hardware) The video mentions pointers in C#, but doesn't mention that apart from the performance gains from doing some C# algorithms with direct pointers and pointer arithmetic (in an unsafe {...} scope), you can use pointers in C# to run inline assembly by getting a delegate function pointer to the start of a byte array representing assembly code. Which means you can get the same or better performance than C/C++ code using assembly for specific functions. I mean aside from just interoperating with C libraries, which you can also do. But Java can do that too. Also not mentioned in the video (because its mainly about the languages not their runtimes), but the .net runtime does tail-call optimization of recursive functions, whereas the JVM does not. You can google what that means, but the Cliff's notes version is: If you write a recursive function where the self reference is the last statement in the function, like this int myFunc(int i) { //do stuff with i if (someExitCondition) { return i; } else { return myFunc(i); } } The .net runtime will optimize it so that there is only ever one instance of the function on the stack. That means it can continue recursing (calling itself) endlessly, without constantly consuming more memory. No matter how many recursions it will only consume the memory required for a single instance of the function. The JVM, in contrast, will create a new instance of the function on every call, while preserving every previous instance, meaning if it recurses for ever it will continuously consume more memory and you *will* eventually get a stack overflow. Also not mentioned: Java *still* doesn't have properties (looks and behaves like a public variable or constant from the outside, getter and setter methods hidden under the hood) or events (much easier than using callback interfaces in Java) as first class language constructs, unlike C#. And they only just introduced pattern matching in Java. C# has had it for something like 7 years. And like most equivalent features, the C# version is much less verbose.
@GavinLon
@GavinLon 11 ай бұрын
Wow - thanks for these additional points. I especially love your point about recursion! When I've got the time I'd love to do a much deeper dive into C# vs Java. The points you make here show just how much thought has gone into .NET and C# optimisations.
@aliksargsyan2782
@aliksargsyan2782 Ай бұрын
First of all using pointer to reach C/C++ performance it is a dream dude, because C/C++ are compiled language while C# not. What about Java, Java's key target is multicore processors via multi threading which is more faster then async await . C# really fast to fetch requests form database, handling file system by using acync await while Java more faster for large data processing by using multy threading. That's why 90% of banking, commercial, enterprise level and critical applications whice requires large data processing are written with Java. That's the main reason that Java relies on traditional multi threading.
@aliksargsyan2782
@aliksargsyan2782 Ай бұрын
First of all using pointer to reach C/C++ performance it is a dream dude, because C/C++ are compiled language while C# not. What about Java, Java's key target is multicore processors via multi threading which is more faster then async await . C# really fast to fetch requests form database, handling file system by using acync await while Java more faster for large data processing by using multy threading. That's why 90% of banking, commercial, enterprise level and critical applications whice requires large data processing are written with Java. That's the main reason that Java relies on traditional multi threading.
@farrenh
@farrenh 9 күн бұрын
@@aliksargsyan2782 You can do true multithreading in C# so that's not really a Java advantage. It's just that Java defaults to multithreading as the idiomatic way of doing concurrency while async is the default idiomatic way of doing it in C# - not the *only* way. That's what makes C# so great. Its *far* more flexible and supports more paradigms in the base language than Java. And I have seen many, many benchmarks comparing optimized concurrent code spawning the same number of concurrent processes written by people who are intimately familiar with both languages and its simply a fact that C# murders Java when you get to very high numbers of concurrent tasks on the same hardware. I mean like 1 million + concurrent tasks. At much lower numbers of concurrent tasks Java has an advantage, but it vanishes and reverses when you scale. My practical experience with both languages and their runtimes makes me certain that the runtime engine is vastly better optimized for scaling, tail recursion and many other aspects .Net than Java's runtime is. It makes me very sad every time I have to work on a bunch of interacting but seperate Java projects (Like clients, servers, apps and libs) because I know that no matter how powerful my dev hardware, the JRE is going to greedily try to grab as much of my machine's resources as possible and not release them until I unload everything. Android Java development using Android Studio is the absolute worst, because even on a new dev laptop with 32GB of RAM I know that opening three projects simultaneously (like an app and two SDK library projects that it uses) and doing a bunch of builds will end up consuming most of my RAM and the machine becoming slightly sluggish and less unresponsive, at which point I must close everything and re-open it before continuing. I feel like people who mainly only develop in Java just don't realize how crap the experience is compared to working with other better optimized stacks. Also using pointers and pointer arithmetic in unsafe blocks of C# code does make it possible to make certain algorithms faster in C#, in a way that is not possible in Java. Its irrelevant to this discussion whether C# is slower than C++ (which is not Java) because its a bytecode language that is executed by a runtime. What's relevant is that it has constructs like unsafe scopes and pointers that make it possible to optimize some algorithms, in a way that is not possible in Java. But since you raised that point - although IIRC this is considered a hack and not recommended - you can actually hack C#s unsafe scopes and pointers to run actual native machine code inline. I've seen tutorials on how to do it. Which I mentioned above. Finally, you can now compile C# to actual native code, like go, rust and C++, in a non hacky way. See this video: kzbin.info/www/bejne/qZKWiaasiM6Aqs0
@joakimdahlstrom2532
@joakimdahlstrom2532 Жыл бұрын
Regarding split classes... Now... I'd argue that the intended group of programmers sat down and at least learn SOLID if ending up having to split the classes :)
@Turko77777
@Turko77777 Жыл бұрын
I don't understand what you're saying
@nicholasbrooks7349
@nicholasbrooks7349 Ай бұрын
I was a java fanboy until I built my first windoss phone app and game with monogame.
@GavinLon
@GavinLon Ай бұрын
Thank you for sharing your experience. I'll have to experiment with monogame myself :)
@RLstavista
@RLstavista 6 ай бұрын
Yes
@henryvaneyk3769
@henryvaneyk3769 Жыл бұрын
Any developer that limits their programming toolbox to a single language is a fool. Rather learn to use both Java and C#, and do not stop there.
@GavinLon
@GavinLon Жыл бұрын
As a new developer, I personally wouldn't waste my time learning both C# and Java. I would specialise in one of these languages but I do certainly agree with learning more than one language, but between Java and C#, I would pick one or the other. I would then perhaps learn Python for machine learning and data science applications. I think regardless whether you are proficient in C# or Java, you should definitely learn JavaScript, especially if you are an aspiring web developer. There are some attractive new languages like Rust or Go - which I would also consider learning.
@vincentfernandez7328
@vincentfernandez7328 3 ай бұрын
the question is very simplistic. You don't consider the historic point of view... From that point of view it was java (sun microsystems) who develop all this new technologies, architecture etc... Microsoft just copied it. From this point of view without a doubt Java is much better. Also you dont consider the frameworks... It is not only the language itself but Java frameworks that were developed ahead of anybody else...
@GavinLon
@GavinLon 3 ай бұрын
I wouldn't say that Microsoft just copied Java. I believe Microsoft was certainly influenced by Java (especially by the Java Runtime Environment and Java Virtual Machine), but I think C# was developed with a view to combine the rapid application development capabilities of Visual Basic and the power and expressiveness of C++ (in fact Anders Hejlsberg even said as much). I have a bias toward C# and .NET but I do appreciate that Java is a very powerful language and platform.
@gurudaki
@gurudaki Жыл бұрын
C# all the way for the future in my opinion...!
@GavinLon
@GavinLon Жыл бұрын
That is also my opinion :)
@sugekanu6163
@sugekanu6163 8 ай бұрын
Yes. C# is my new goto. I just started learning C# and it looks similar to java but simpler. Thanks for your tutorials and guides.
@GavinLon
@GavinLon 8 ай бұрын
You are very welcome. Java is a great language but as you say, C# is perhaps simpler to use. :)
@aliksargsyan2782
@aliksargsyan2782 3 ай бұрын
Java is more robust actually)
@nepalxplorer
@nepalxplorer Жыл бұрын
C# definitely wins!
@GavinLon
@GavinLon Жыл бұрын
I agree!!! :) Thank you!
@daniel-peiro
@daniel-peiro Жыл бұрын
Html is the
@bigbilly29
@bigbilly29 5 ай бұрын
Great video earned a sub. Cut nails
@GavinLon
@GavinLon 5 ай бұрын
Thank you! :)
@ripple123
@ripple123 Жыл бұрын
java ecosystem >> C# ecosystem
@GavinLon
@GavinLon Жыл бұрын
Sure the Java ecosystem is bigger but as time goes on that gap is likely to close. :)
@julianjupiter5890
@julianjupiter5890 Жыл бұрын
⁠@@GavinLonand language features gap between Java and C# will also close.
@GavinLon
@GavinLon Жыл бұрын
@@julianjupiter5890 Well that will certainly improve Java - perhaps I can do a more comprehensive deep dive into the comparisons between C# and Java at a later stage. Thanks for your comment - great to get the perspective of someone who is clearly pro Java! :)
@Turko77777
@Turko77777 Жыл бұрын
because it has to patch the shortcomings
@ronaldjohnson4470
@ronaldjohnson4470 Жыл бұрын
My preference is C#.
@GavinLon
@GavinLon Жыл бұрын
My preference is also C# and .NET :)
@astrahcat1212
@astrahcat1212 Жыл бұрын
Well, I think it's more about, all these companies are still using Java systems, so if you're a very experienced programmer you can make a lot of money using Java. C# is kind of more modern and these days I believe blowing past Java due to Microsoft's support. Python is still the best language to learn today though I think.
@GavinLon
@GavinLon Жыл бұрын
Yup I think once a company is committed to a technology (like Java) - it often doesn't make sense to move to a more modern technology because of the cost involved. I think having Microsoft support is a huge reason to develop green field applications using .NET and C#. Python is a great language but C# is better in my opinion, one of the main reasons being that C# is a statically typed language. I also think C# is a fairly easy language to learn.
@astrahcat1212
@astrahcat1212 Жыл бұрын
@@GavinLonI'm actually more of a C# programmer myself, but learning Python I do enjoy the quick compilation with it being interpreter based. The younger generation all seem to be learning Python though, and CS students and many companies, so I think it'll continue to expand and grow. C#'s syntax still makes perfect sense to me though.
@GavinLon
@GavinLon Жыл бұрын
@@astrahcat1212 Python is a great language, and of course great for AI and data science applications. I prefer C# for many reasons but think Python is a great first language to learn primarily because of its simplicity. :)
@flogginga_dead_horse4022
@flogginga_dead_horse4022 11 ай бұрын
yes
@GavinLon
@GavinLon 11 ай бұрын
👍
@kaihusravnajmiddinov5413
@kaihusravnajmiddinov5413 5 ай бұрын
C# and its ecosystem is (nowadays) developed by more smarter people than those in Oracle struggling to develop java. That's the main, perhaps only reason why c# is really more productive in action.
@GavinLon
@GavinLon 5 ай бұрын
As you have alluded to in your comment, Microsoft is certainly in a position where they can hire the best people :) That of course is reflected in the quality of their products.
@kaihusravnajmiddinov5413
@kaihusravnajmiddinov5413 5 ай бұрын
@@GavinLon yes, agree. But again, I am not sure if any tech company which got similar financial capability may reach the same results. E.g. apple is very rich company, but it's programming languages (objective c, swift) are far from being good problem solver, rather than on it's own hardware.
@GavinLon
@GavinLon 5 ай бұрын
@kaihusravnajmiddinov5413 Interesting point, I do think for e.g. Anders Hejlsberg (who lead the team that designed and developed C#) is exceptional.
@flogginga_dead_horse4022
@flogginga_dead_horse4022 11 ай бұрын
Been programming for 25 years, could never stand Java. Still using C# or Rust now at this point.
@GavinLon
@GavinLon 11 ай бұрын
I'm looking forward to C# vs Rust at some point!
@kaihusravnajmiddinov5413
@kaihusravnajmiddinov5413 5 ай бұрын
How's RUST?
@aliksargsyan2782
@aliksargsyan2782 3 ай бұрын
Haha 😆 Rust. That's why Intel cpus chashes because of Ruat 😂
@flogginga_dead_horse4022
@flogginga_dead_horse4022 3 ай бұрын
@@aliksargsyan2782 learn spelling first?
@aliksargsyan2782
@aliksargsyan2782 3 ай бұрын
@@flogginga_dead_horse4022 crashed dude crashed.
@ievgenmajor3301
@ievgenmajor3301 10 ай бұрын
c# features looks like disadvantages
@GavinLon
@GavinLon 10 ай бұрын
Interesting - could you elaborate on that a bit? :)
@izagawd
@izagawd 2 ай бұрын
Yeah please elaborate
@benderbg
@benderbg Жыл бұрын
C# and Java can be called OOP language siblings. After all C# was developed as a Java clone. Why not learn both and be a true back end guru! Now days, C# has a nicer syntax and feels more modern. Java on the other hand has bigger ecosystem not tide to only one company. There is a reason why big tech don't prefer C# because everything around it is opinionated. If you want maximum out of it you need to be in Windows/Azure world. I'd also like for Microsoft to port Visual Studio to Linux. Its not really cross platform language until it has full IDE support it deserves. MAUI is also not supported on Linux at all.
@GavinLon
@GavinLon Жыл бұрын
Very interesting comment! I really enjoyed reading it! With every release of .NET there seems to be amazing progress, so I think with the heavy investment in C# and .NET by Microsoft - we'll see a lot of positive changes - perhaps that will address the issues that you have mentioned in your comment. Having said that , I do like a lot of the points you make here :)
@rankarat
@rankarat Жыл бұрын
C# runs on linux perfectly!
@GavinLon
@GavinLon Жыл бұрын
@@rankarat Yes I believe you can run .NET MAUI apps on Linux - I haven't tried it yet myself but I think it can be done - techcommunity.microsoft.com/t5/educator-developer-blog/net-maui-on-linux-with-visual-studio-code/ba-p/3982195
@eriknyk2k
@eriknyk2k Жыл бұрын
C# copied Java since it born
@GavinLon
@GavinLon Жыл бұрын
C# is certainly not a Java clone and is much closer to C++ in its design. It of course does have a lot in common with Java. One has to bear in mind that both of these languages are both C based and support object oriented programming. Anders Hejlsberg (the designer of C# at Microsoft) said the goal (when creating C#) was to provide the power and expressiveness of C++ as well as the rapid application capabilities of Visual Basic. Certainly the JVM and the CLR are very similar when comparing .NET to the JRE - the C# language itself, however, has evolved and seems likely to continue to evolve far beyond Java.
@eriknyk2k
@eriknyk2k Жыл бұрын
@@GavinLon It isn’t anymore, but here’s a brief history: In the late 1990s, Sun Microsystems developed a language they called Java. At the time, most programs were written for a specific operating system. Some languages were “portable”, but the source code had to be recompiled for every new system. Java allowed a program to be written once, compiled and then run on any operating system. Nifty! In addition, small programs could be run inside a web page. Microsoft got on board and started supporting Java: they supported it in their browser and even released a version of their IDE for it. While doing this work, they came up with ways of improving Java just for Windows. This pissed off Sun, because that was the opposite of what Java was all about: the same program was supposed to run the same on all devices. It wasn’t supposed to be different for different operating systems. Microsoft got mad that Sun was being mean to them, and withdrew native support for Java in their browsers and killed their Java IDE. They decided to make their own competing language, which brought us C#. In the beginning, C# was similar to Java in many respects. Java compiled to “byte code”, which was then executed by something called the Java Virtual Machine (JVM). C# compiled to Microsoft Intermediate Language (MSIL), which was the same idea as byte code. It was then executed by the .NET Framework, which was an idea similar to the JVM. C# borrowed a number of ideas from Java, such as the lack of raw pointers, using . for dereferencing always instead of . sometimes and -> at other times, a construct that C++ used. But right from the start, there were differences. Anders Hejlsberg, the lead designer of C#, added something called properties, which were a big boon to C# programming, and still are. They also included enums, which Java lacked (Java has them now, but considers them full classes or some such weirdness). Now, almost 20 years later, C# has a number of features that Java can’t touch. I won’t cover them here, but C# is less of an imitation of Java now than it originally was. C# and Java continue to borrow from each other as each continues to try to one-up each other. They still share a number of similarities. Most C# programmers would have little trouble reading Java and vice-versa (though a Java programmer’s head might explode trying to read some LINQ statements). C# started out as an imitation of Java (or a competitor), but now stands on its own.
@priyanshu4016
@priyanshu4016 Жыл бұрын
java and only java , :D wins
@GavinLon
@GavinLon Жыл бұрын
What!!!?????? lol - Just kidding - okay - one for the Java team!
@anm3037
@anm3037 Жыл бұрын
I still wonder how😂java programmer manage to work without extension methods
@GavinLon
@GavinLon Жыл бұрын
Yes, I'm also used to luxuries like extension methods and auto implemented properties provided by C#. :)
@eugenschabenberger5772
@eugenschabenberger5772 Жыл бұрын
You forgot to mention the dumb checked exceptions in Java.
@GavinLon
@GavinLon Жыл бұрын
In the end I actually had to leave a lot out because it would've made the video too long :)
@7th_CAV_Trooper
@7th_CAV_Trooper 7 ай бұрын
yes. the answer is yes.
@carosan3719
@carosan3719 Жыл бұрын
Kotlin
@GavinLon
@GavinLon Жыл бұрын
Okay challenge accepted - coming soon - Is C# better that Kotlin?
@RuanStrydom
@RuanStrydom 11 ай бұрын
No challenge. Kotlin is a much safer language. It prefers immutability over mutability. Coroutines enforces structured concurrency and is generally just better designed. Sequences vs the random implementations of Ienumerable. The list goes on and on. .Net == infinite runtime errors. Oh and not to mention kotlin multiplatform and all it's targets, JS, wasm, native, JVM.
@GavinLon
@GavinLon 11 ай бұрын
@@RuanStrydom Thanks for your strong views - well I look forward to diving into this comparison further. I disagree about .NET = infinite runtime errors. In my experience .NET is very robust.
@RuanStrydom
@RuanStrydom 11 ай бұрын
@@GavinLon I would argue Rust is robust. Type safe functional languages are robust. A mutable language with unbound concurrency I would not describe robust. I'm looking forward to the video, I hope you spend some time with it, it's a good language. Not great but good. PS I'm currently in a C# job.
@GavinLon
@GavinLon 11 ай бұрын
@@RuanStrydom Thanks so much for your interesting comments :) Its great to get a variety of perspectives. I'm looking forward to exploring Rust!
@dotnetMasterCSharp
@dotnetMasterCSharp Жыл бұрын
I like working with languages ​​in the c family. Because it is closer to machine language. I haven't tried it with Java yet. The information in the video was very helpful for my understanding of Java. Thank you!
@GavinLon
@GavinLon Жыл бұрын
Great! I do like the c-style syntax myself! Thank you for your comment and you are very welcome!
@H4KnSL4K
@H4KnSL4K 5 ай бұрын
It looks like everything in C# is capitalized. Boo! This goes against like every other programming language. It reminds me too much of power shell. Ick. Give me bash and Java any day
@GavinLon
@GavinLon 5 ай бұрын
Great, thank you for your comment! :)
@BackendWithJava
@BackendWithJava 2 ай бұрын
Java is the best programming language! Even your C# is trying to be like Java 😂
@GavinLon
@GavinLon 2 ай бұрын
lol - there are definitely similarities between the two languages but I think C# left Java behind a long time ago :)
@lufenmartofilia5804
@lufenmartofilia5804 17 күн бұрын
They kinda copy each other over the years. Java take c# as a testing ground and only take features that they think make sense. C# is looking into copying java's virtual threads at the moment as it is a clean and very lightweight way to transform blocking code to none blocking one on a giant scale (1kb per vthreads vs 1mb for a thread). Allowing you to pop millions of them without running out of ram
@miyu545
@miyu545 Жыл бұрын
Java hands down wins in a game development scenario, outside of that Java is simply just not the best choice anymore. C#!
@eugenschabenberger5772
@eugenschabenberger5772 Жыл бұрын
Unity c#, Unreal c++, Godot Gdscript or c#. Where is Java?
@farrenh
@farrenh 10 ай бұрын
C# is hands-down better for game dev. 2 of the 3 most used game engines (Godot and Unity) support C#, with good reason. Java isn't even on the map in serious game development, although if you're developing games that don't require optimal performance, you can certainly use Java if you want to.
@izagawd
@izagawd 2 ай бұрын
Only game they used to make with Java that is popular is Minecraft, and even with that they made bedrock edition (with c++) because it was better suited
@TheBunzinator
@TheBunzinator 17 күн бұрын
COBOL is better than Java, so yes.
@GavinLon
@GavinLon 17 күн бұрын
We'll have to see about that! Sounds like a great topic for a video :)
@TheBunzinator
@TheBunzinator 17 күн бұрын
@@GavinLon Lol. :D I dare you! But if you do, please don't use an example of COBOL code that includes all the mainframe build JCL that everyone seems to include when they disingenuously want to make it look insane and unreadable. I don't actually like COBOL at all, but it's great at what it was designed for.
@GavinLon
@GavinLon 17 күн бұрын
@TheBunzinator lol - COBOL is such an old language - not sure it would be a very popular topic! If I do the video, however, I will definitely take your advice. Thanks! :)
@IgorLisx
@IgorLisx 11 ай бұрын
I prefer to stay away from anything that originated from Microsoft.
@izagawd
@izagawd 2 ай бұрын
Yes
Is C# Better than JavaScript?
17:53
Gavin Lon
Рет қаралды 5 М.
Java 21 Is Good?! | Prime Reacts
27:08
ThePrimeTime
Рет қаралды 248 М.
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
The IMPOSSIBLE Puzzle..
00:55
Stokes Twins
Рет қаралды 187 МЛН
How to Become a Highly Employable C# Developer in 2024
17:47
Gavin Lon
Рет қаралды 19 М.
Is C BETTER than C++ for beginners? // Code Review
31:16
The Cherno
Рет қаралды 60 М.
Is Blazor Better than Angular?
15:57
Gavin Lon
Рет қаралды 10 М.
What's new in .NET 9 and C# 13
19:21
Filip Ekberg
Рет қаралды 18 М.
What is the Java Job delusion?
12:23
Stefan Mischook
Рет қаралды 139 М.
The New Option and Result Types of C#
15:05
Nick Chapsas
Рет қаралды 80 М.
Why I’m Switching To Go in 2024
8:10
Awesome
Рет қаралды 91 М.
The Value of Source Code
17:46
Philomatics
Рет қаралды 204 М.
Creative Justice at the Checkout: Bananas and Eggs Showdown #shorts
00:18
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН