Comparing C# to Java - I Code in Both. Learn about the Differences and Similarities.

Sdílet
Vložit
  • čas přidán 6. 06. 2024
  • Whether you are a programmer or project manager, developers are always defending their favorite programming language. To help determine what software engineering platform will work best for your next project, Chuck explains the differences and similarities of Java language/platform and C# and .Net platform.
    From syntax to performance this presentation focuses on the developer experience on both platforms!
    While Java and C# have lots of similarities, there are significant differences. Anyone wanting a better view, an objective view of the 2 platforms will learn in this video. With actual code samples and humor, Chuck hits on the major points.
    Check out our website at www.McCulloughAssociates.com
    Chapters:
    0:00 Introduction
    0:27 The Slap
    0:48 Philosophy
    2:18 What they have in Common
    2:56 A Sample Class for Both
    3:33 Primitives
    4:37 Type Specifiers
    5:35 Operator Overloading
    5:58 Functional Programming
    6:33 Exceptions
    7:20 Garbage Collection
    8:00 Generics
    8:33 LInQ
    8:58 Performance
    10:16 Recommendations
  • Věda a technologie

Komentáře • 470

  • @gooroomp
    @gooroomp Před 2 lety +298

    As a developer who has a lot of experience in both of these languages, I believe you did a very good job in comparing the two. That said, I strongly believe if you CAN do what you want in C#, there's almost no argument that persuades you to use Java. Basically, if you have to use Java to use a certain library, by all means, do it. But if I had to choose either of these languages I would NEVER choose Java. There are so many things wrong with it (Unicode?)

    • @Tempest4935
      @Tempest4935 Před 2 lety +11

      Ya I'm not against 3rd party dependencies but I do cringe a little bit when I take one on. 😖

    • @bluesillybeard
      @bluesillybeard Před 2 lety +18

      Generics.
      Java's generics are the most annoying thing in the history of the universe.

    • @kingigzorn7680
      @kingigzorn7680 Před 2 lety +14

      Done both, i love javas simplicity. Who wants to drive a Mercedes If He can just fly

    • @penniesshillings
      @penniesshillings Před 2 lety +33

      I love Java, have used it for over 20 years. I know it inside and out. It's a terrible language... ;-(

    • @bluesillybeard
      @bluesillybeard Před 2 lety +4

      @Jan Krynicky Yes, but 'this.equals(that)' takes second place imo

  • @_FGTS
    @_FGTS Před rokem +113

    the LINQ feature of C# sounds amazing. It looks like an incredible new approach to deal with list manipulation. I'm astonished.

    • @kazinix
      @kazinix Před rokem +11

      I've been using LINQ for almost a decade now, every time I have to switch language, I see myself looking for something similar. I used Phinq in PHP, linqjs in JavaScript.

    • @Foxfried
      @Foxfried Před rokem +3

      Stay the hell away from that. the Data layer should never be bastardized into the code layer.

    • @raianmr2843
      @raianmr2843 Před rokem

      ironically linq is sorta neglected by microsoft and unoptimized af. but of course, that shouldnt be relevant to you when youre just prototyping or smth

    • @rodrigo-tj1gf
      @rodrigo-tj1gf Před rokem

      Yeap, i absolutely love writing linq queries

    • @laughingvampire7555
      @laughingvampire7555 Před 11 měsíci

      C# has nothing original, everything is copied from somewhere else. LINQ is just a copy from a feature from Haskell that Haskell itself copied and refined from Python.

  • @vert3cx373
    @vert3cx373 Před 2 lety +219

    C# has less boilerplate, fantastic syntactical sugar features which make coding a breeze (Once you know them), extension methods are really awesome for configuring services for application startup (IServiceCollection). The new MinimalApi makes writing API endpoints super simple and fast for simple dev testing etc. All in all, it feels like a more modern language which has matured well, unlike Java. Sorry if I ruffled some feathers but it's just my opinion. :)

    • @staubsauger2305
      @staubsauger2305 Před 2 lety +2

      Try Groovy as a "Better Java" sometime.

    • @pauldanielmooney
      @pauldanielmooney Před 2 lety +6

      Syntactically Java is very out of date, and in my mind it always will be until it can do simple things like auto properties (adding a library like Lombok that requires IDE plugins and build alterations doesn’t count), and more advanced things like Async Await.
      I believe it’s advantage is that is has a good trusted ecosystem in spring, Apache commons, and a few others.
      I want to say Kotlin is the answer here but even that language seems to stumble in a lot of places. At least that’s how it seems with my current understanding of it.

    • @punsmith
      @punsmith Před 2 lety +8

      @@pauldanielmooney Sadly, Kotlin will always be limited by Java itself. It simply can't solve what a mess it has become.

    • @victorbukowsky7496
      @victorbukowsky7496 Před 2 lety +1

      @@pauldanielmooney Agree with everything that was commented here, by everyone. Completely. Yeah, Java is just out of date. And it can't change that - Oracle has to support backward compatibility with everything that was made before. So it's just stuck there, with 1990s format. Yep, Lombok is nice autoprops copy, but it's not that integrated, and requires another library. Etc.

    • @victorbukowsky7496
      @victorbukowsky7496 Před 2 lety

      @@staubsauger2305 Oh lord, I haven't even touched on Groovy lol More learning? When do I get to actually DO in Java? lolol Java is one big chore and headache, and all these half-arsed attempts to make it human - like Maven, Gradle, Groovy, Kotlin - it's just another layer of headaches. Instead of actually giving us simple tools to BUILD - Oracle is focused on pandering to their corporate overlords.

  • @suleman.khalid
    @suleman.khalid Před 2 lety +207

    Another different is that Java developers wear glasses, because they can't C# ;)

  • @rilauats
    @rilauats Před 2 lety +5

    Chuck - great work, great content. Thank you for sharing your experience, your wisdom. I really like your level-headed language comparisons.
    Having worked with software development for 40 yrs I cherish a valuable source when I see one. You earned my subscription after just one video.

  • @iluvsyphonfilter
    @iluvsyphonfilter Před rokem +5

    Thanks for making this video, I was curious on the differences between these languages and you explained those differences very well!

  • @supercyclone8342
    @supercyclone8342 Před rokem +25

    Amazing comparison! My main language is C# and I recently learned Java and... I don't hate Java per say, but it just seems inferior to C# in every way, especially since C# is now multiplatform (though I've only ever used Windows anyway).
    My typical workflow relies heavily on things like properties, events, nullables, and LINQ, so whenever I use Java I'm constantly bumping into inconvenience after inconvenience. Even if they're minor, they add up to frustrate me quite a bit, so this video kind of validates those feelings lol.

  • @MarkVrankovich
    @MarkVrankovich Před 2 lety +92

    C# only has two characters in its name, whereas Java has four. Obviously C# is faster to type. Java on the other hand takes up more of your life, two characters more to be precise, every time you need to mention it in an email or doc, etc... Of course, I only ever use C.

    • @yasirhantoush
      @yasirhantoush Před 2 lety +12

      the c# reads two characters, but it actually needs 3 keyboard strokes , the c , the shift and the 3 ;p)

    • @bharathb4803
      @bharathb4803 Před 2 lety +2

      @@yasirhantoush Yes, so?

    • @rolandtennapel5058
      @rolandtennapel5058 Před 2 lety +4

      I respectfully disagree; I think C# shows more character 😁

    • @chowhar
      @chowhar Před 2 lety +3

      C is a bit flat in comparison, but is the base and generally the more major of the two! 🎶

    • @MulleDK19
      @MulleDK19 Před 2 lety +2

      You use C? What a waste of time! I exclusively use

  • @tomjose4815
    @tomjose4815 Před rokem +2

    This is one of the best comparison videos i have ever come across. it cleared up lots of my doubts. Thank You

  • @cyrusmagnus
    @cyrusmagnus Před 2 lety +20

    Thank you for this Chuck. As someone trained on Java and C++ I'd been wondering for some time what exactly the difference was in C#. After watching this and your C++ vs C# video, I now have a much better appreciation of the differences.
    Going to see if you've made any videos on Kotlin now, as I'm learning that language on the side for funsies atm.
    Cheers.

  • @Benexdrake
    @Benexdrake Před 2 lety +14

    learning C# for over 2 Years now and im loving it, for me, it is better as Java.

  • @laurence8528
    @laurence8528 Před 5 měsíci +3

    why I love C#:
    - Async / Await
    - Extension Methods
    - Expression Bodies
    - Optional Params
    - Ref, Out Params
    - Auto Properties
    - Events, Delegates
    - Linq
    - Structs
    - Interop
    and.....
    string.IsNullOrEmpty(), an important feature that java lacks😆

  • @adhamabdelwahab
    @adhamabdelwahab Před 10 měsíci +1

    Thanks for the video Chuck. I'm starting a new position at work and have a flexible manager willing to put me on teams that either work with java or C#. I don't have much industry experience or experience with those languges outside of a few projects. This video helped me understand things differently and has me leaning towards joining the C# developers more than I already was. Thanks again

  • @IvanRandomDude
    @IvanRandomDude Před 2 lety +44

    Generics not accepting primitive types was one of the things I was shocked by when I started using Java.

    • @ryanisthewind
      @ryanisthewind Před 2 lety +7

      I'm still waiting for the time I can use Generics. I didn't see any use case for them🥲

    • @NOTturke
      @NOTturke Před 2 lety

      This isn’t true, you can use the wrapper classes

    • @nallid7357
      @nallid7357 Před 2 lety +4

      @@NOTturke wrapper classes are classes, not primitive types. Integer and int are not the same thing.

    • @NOTturke
      @NOTturke Před 2 lety

      @Jan Krynicky true, it is pretty annoying to have to have an entire object with methods just for a single value

  • @ziaulhasanhamim3931
    @ziaulhasanhamim3931 Před 2 lety +44

    you forget about async-await. one of the most important think that java doesn't have till now and c# was one of the first languages to introduce async-await.

    • @hilligans1
      @hilligans1 Před 2 lety +5

      We have futures in java

    • @yuitachibana8829
      @yuitachibana8829 Před 2 lety +7

      They meant the syntactic sugar comes with multitasking in c#, the syntax make asynchronous code looks like synchronous code and avoid callback hell

    • @Alguem387
      @Alguem387 Před 2 lety +9

      C# was in fact the very first to implement async await

    • @ImaginaryNumb3r
      @ImaginaryNumb3r Před 2 lety +1

      C# will weep once Java Continuations arrive via Project Loom.

    • @Alguem387
      @Alguem387 Před 2 lety +4

      @@ImaginaryNumb3r and other hilarious jokes you can keep telling yourself

  • @ozgurugur5196
    @ozgurugur5196 Před 2 lety +55

    Thank God for the competition created by Java. Otherwise, there would not be such a shining and powerfull language called c#. For more than 20 years I have been coming across such comparisons. In the beginning, it was "c vs java". C# takes features from java (vm, open-source philosophy), java takes features from kotlin (records) , c# (lambdas, virtual-threads), javascript (promises, declarative programming, reactive)(and golang latest version supports generics at last). The thing you have chosen is not only the language itself, it 's also the open-source community behind the scenes. Long live open-source, even the companies have been funding foundations to drive the open-source community.

    • @IHaveYourMilk
      @IHaveYourMilk Před 2 lety +2

      Love your view on this, very well put.

    • @kazinix
      @kazinix Před rokem +2

      Makes me happy when a language adopts features from another language.

    • @RogueTravel
      @RogueTravel Před rokem +1

      Kotlin/Swift/Typescript front ends with a C# backend, and I have to say, languages are in a good place at the moment. All of the native front ends do a great job of not getting in the way while providing great developer experiences. C# and .NET are great as well, with batteries included. If I had to use the JVM, I would go with Kotlin over Java.

  • @yogibarista2818
    @yogibarista2818 Před 2 lety +12

    String-variable Interpolation is a nice syntax feature in C#

  • @saarcfashion1196
    @saarcfashion1196 Před 2 lety +7

    In 2008, I got the option to choose either PHP or Dotnet for my career path. But, now I am proudly saying that it was the best decision of my life forever. My current goal is to bag a C# Web Application Developer job in the USA, and I hope very soon will succeed.

    • @G5STU
      @G5STU Před rokem +2

      i program in php all day for web and C# in the evening for personal desktop apps, I'm also using C++ for some heavy lifting. Programmers should see languages at tools, you don't pick just one to do everything, the right tool for the job. I don't care what language i'm coding in, so long as it's easiest way to get the job done. It's all just code, some languages are just better at certain things.

  • @GadOcansey
    @GadOcansey Před rokem

    The best video on this war between C# and Java.

  • @EruWan_Ernest
    @EruWan_Ernest Před 2 lety +3

    As non programmer I enjoyed this content!

  • @Lucas-mo1ko
    @Lucas-mo1ko Před rokem +31

    I believe in C# supremacy ! It feels more modern and Microsoft is upgrading it a lot since NET5 open-source. Anyway, I'll always respect Java and we'll still see it around for a while, but working with C# and Typescript for frontend (also Microsoft) is a great combination!

  • @jordanweir7187
    @jordanweir7187 Před 2 lety +1

    This is a great comparison dude thanks, very informative

  • @ramprasanthudhayabaskar8073

    Wow, nice video..!! Best comparison I ever saw.. Thank you for such a great content..

  • @_b001
    @_b001 Před 2 lety +9

    For sane and comfy ecosystem: c#
    For more jobs: Java.

  • @obeid_s
    @obeid_s Před 2 lety +18

    In Java i could not access Memory Mapped Files, also there is no unsigned,
    I tried c# and it was super good.
    Thank you.

  • @MrAikien
    @MrAikien Před 2 lety +1

    Very informative.
    Thanks! 😊👌👍

  • @thePrzemko17
    @thePrzemko17 Před 2 lety +12

    4:55 C# dynamic is not a tuple. its a proper dynamic type, like a dynamic type in java script.

  • @sirnigelcogs
    @sirnigelcogs Před rokem

    A very good job at explaining things.

  • @jeanahollings
    @jeanahollings Před 8 měsíci +5

    Thank you so much!
    My only comment is: you didn't mention database integration. I'm still a bit of a programmer newb but all my coder friends are clear: if you're going to build an application that is tied a database, go with C#. And I can't argue with that. I've done the integration in Java and it is annoying but I've seen it in C# and it was seamless.

    • @Darietable
      @Darietable Před měsícem +1

      Idk man, with spring boot and hibernate it's never been easier

  • @johnforde7735
    @johnforde7735 Před 2 lety +1

    I would be interested on you take on Swift. Maybe in comparison to C#, which is relatively close.

  • @saintinel
    @saintinel Před rokem +30

    C# is pure comfort, compared to Java...
    And also MS Visual Studio is the ultimate best editor by far!
    I really wouldn't want to use anything else ever again.

    • @martinsandor707
      @martinsandor707 Před 11 měsíci

      Visual Studio does have some very comfortable features, but to me it felt cumbersome how many times it tried to incorrectly predict what I wanted to write. I could probably tweak it if I wanted to spend time with it, but I mainly use Java and IntelliJ has to be my #1 choice, i never had problems like I do with VS.

    • @shadmansudipto7287
      @shadmansudipto7287 Před 10 měsíci +1

      @@martinsandor707 bruh. You're talking about intellicode which is a copilot assistant. Just turn it off if you don't like it. "I don't like this car because there was a pack of bad tasting chocolates in the glove box".

    • @zaspalia
      @zaspalia Před měsícem

      @@martinsandor707Jetbrains makes Rider for C# which is almost the exact same IDE as intelliJ. You’d feel right at home with it.

  • @jespersahnerpedersen
    @jespersahnerpedersen Před 2 lety +1

    Miss anonymous classes in C# which has been in Java from the beginning. C# supports anonymous methods (delegates and lambda expressions) and types (properties) but for some reason not full classes.

    • @eugenpaval
      @eugenpaval Před 2 lety +1

      Anonymous classes are supported in C# albeit most programmers will use them just to bunch together a set of properties. However an astute observer may notice that a property can be in fact a lambda. These classes are extremely useful in Linq, especially in fluent form when results from previous method calls are chained in the next call as anonymous objects.

  • @andrewnorris5415
    @andrewnorris5415 Před 2 lety

    I got a book out of the library on Java once. The librarian said she had been there and highly recommended it.

  • @MrBloodsucker27
    @MrBloodsucker27 Před 2 lety

    This method works perfectly .. thanks for sharing ;)

  • @TheBoxyBear
    @TheBoxyBear Před 2 lety +8

    Small clarification: Both Java and C# offer features through classes, but C# simply offers syntax aliases for these classes, which are sometimes structs. Like with the nullable example, the question mark is removed in CL and becomes a reference to the generic Nullable struct. You may use the struct like any other and the values are interchangable with variables defined using the nullable syntax, but IDEs may detect the use of the struct and suggest the designated syntax.
    This also extends to LINQ for which the query syntax shown is an alias for a chain of LINQ extension method calls. This doesn't mean the lack of extension methods is preventing Java from having something comparabie to LINQ. In reality, you could always use method calls inside method calls just like you can in C# through the static Enumerable class. The reason LINQ is based on extension methods in the first place was to simplify the syntax when calling the methods. The query syntax was only added later to further, making it ressemble SQL.
    As for checked exceptions, although there is no way to signal potential exceptions that will have an impact on the assembly, C# does support signaling of potential exceptions through XML documentation that references the assembly. This allows for an IDE to read the documentation file and show context-sensitive documentation including possible exception at the programmer's request.

    • @kazinix
      @kazinix Před rokem +1

      I love syntactic sugar, makes it easier to write and read the codes.

  • @jolodejesus
    @jolodejesus Před 2 lety +1

    Great video, could you recommend a beginner book for both Java & C#? Thanks!

    • @McCulloughAssociates
      @McCulloughAssociates  Před 2 lety

      There are so many books for each. Everyone has a different learning style, so hard to recommend a specific book.
      Take a look at my intro C# playlist also.
      czcams.com/play/PLXd94bZTzZ-QaMgLp41ZUb_w0sjLBGjUp.html
      I have a lot more content coming soon!

  • @Android-17
    @Android-17 Před 2 lety +2

    What an excellent video👌

  • @matterb6049
    @matterb6049 Před 2 lety +4

    Both are good, for me it depends on what I'm doing, but I do lean toward java, thers a Order about it that helps me remember more of my code for those big projects

  • @denis.akopyan
    @denis.akopyan Před rokem +4

    This is the first Java v C# video that is up to date, and does a wonderful comparison of the two languages. Too bad it doesn't mention async await.

    • @McCulloughAssociates
      @McCulloughAssociates  Před rokem

      What Does async & await Really Do in C#? Learn all about Async Await in C#
      czcams.com/video/uhNVM_7CXu4/video.html

    • @Longmanrus
      @Longmanrus Před rokem

      Or ExecutorService class and Future Interface in java

  • @victorbukowsky7496
    @victorbukowsky7496 Před 2 lety +8

    lol this is some thick material. Awesome comparison. I work in both, and I greatly greatly prefer C# and .NET. I could go on for hours why - it's just everything is already packaged for you, from a single source really - Microsoft. In Java, you, the programmer, has to sit there and configure third-party tools - it's a major nightmare! Version matching is horrendous. Yes, there is Maven, etc. But it's another thing you have to waste time and effort on, just to make it work! And any issues with that - you are on your own, good luck lol!

    • @RustedCroaker
      @RustedCroaker Před rokem

      "a single source really - Microsoft"
      That exactly what kills C# for me. Being dependent on a single source is never a good idea. Especially if that source is Microsoft.

  • @alexclark6777
    @alexclark6777 Před 2 lety +4

    Microsoft sacrificed backwards compatibility by implementing generics from the ground up the right way. Java maintained backward compatibility by utilizing type erasure. However, there are more implications than just Reflection. The vast majority of generic programming surrounds the collection types, which use an array as their backing store, and the difference is particularly evident for primitive value types. If you wanted a Java List and the bools have to be converted to objects (boxed), they're taking significantly more space on the heap and getting scattered (your array now holds references to other heap locations). A .NET List uses an actual concrete array of bool behind the scenes, should hold the data in a contiguous block of memory, and doesn't suffer from the same inefficiencies.

    • @alexclark6777
      @alexclark6777 Před 2 lety +3

      @@ThiagoPagogna Java programs don't run for long enough to cause a BSOD, they consume all system memory and freeze up long before that happens. Cope.

    • @MulleDK19
      @MulleDK19 Před 2 lety +1

      "should hold the data in a contiguous block of memory"
      And does.

  • @mbip2014
    @mbip2014 Před 2 lety +1

    Please post a video between Java vs C# vs Python. It's my humble request.

  • @protox4
    @protox4 Před 2 lety +22

    Generic classes being generated for each generic type doesn't just matter for reflection. It also matters for performance and static fields. Java uses type erasure, which means generics are fake. Every value type is boxed to an object. C# uses real generics where value types are not boxed and can be accessed directly. C# generics are closer to C++ templates, but not exactly the same.

    • @fnamelname9077
      @fnamelname9077 Před 2 lety

      Yes, but C# doesn't use type-erasure, which inflates application sizes.

    • @protox4
      @protox4 Před 2 lety +1

      @@fnamelname9077 That's only true for AOT compiled applications, which most are not (native AOT is still in preview). The JIT creates the types on the fly at runtime so the application size can remain small. That's part of why AOT uses stripping to remove unused code to reduce application size.

    • @fnamelname9077
      @fnamelname9077 Před 2 lety

      @@protox4 True, but that's just changing a memory pressure for a computation pressure.

    • @protox4
      @protox4 Před 2 lety

      @@fnamelname9077 Well that's just the nature of software. There are always trade-offs.

    • @fnamelname9077
      @fnamelname9077 Před 2 lety

      @@protox4 One of the tradeoffs, is reducing the efficiency of coding in order to obtain the same computational result for a lower operating cost.

  • @sachinkumarbadiger3541
    @sachinkumarbadiger3541 Před 10 měsíci

    @ 9:00 the background music scared me! Lol.. I was watching it late night with my headphones on, suddenly the bass note goes bwooooooon! very useful information sir.. thanks for sharing.

  • @ChrisBrown-dn3tf
    @ChrisBrown-dn3tf Před 2 lety +5

    I like java because it's simple. When I program in C++, it looks a lot like java, and is easier to read in my opinion than C++ code I read on the internet that makes use of all C++'s special features.

  • @stanislavmozolevskiy8346

    This video is actually pretty good and informational. I wish it was a little bit more entertainment. You should consider changing background and add couple of modern jokes. Otherwise, definitely subscribe and like!

  • @Grimlock1979
    @Grimlock1979 Před 2 lety +13

    The way Java handles generics has been a frustrating experience for me for many years.

    • @alessioantinoro5713
      @alessioantinoro5713 Před 2 lety +1

      No worries, Oracle is re-working on generics, maybe in 1-2 years it will be less frustrating

    • @cod3r1337
      @cod3r1337 Před 2 lety

      @@alessioantinoro5713 I'm afraid you are being overly optimistic on the timeline. Project Valhalla has yet to finish even "phase 1" (value types), and from there it's still a long way towards specialized generics. An inofficial estimate I've read on that is around 2025. And even that sounds optimistic to me.

    • @alessioantinoro5713
      @alessioantinoro5713 Před 2 lety

      @@cod3r1337 🤷

  • @barionlp
    @barionlp Před 14 dny

    you forgot that C# gives you the option to write low level code. So i can just write my Application using all of C#s benefits and only write the performance critical parts in a unsafe way without having to write them in a whole other language.
    I also like how C# adopts so many functional features, combining the best of both worlds

  • @billbez7465
    @billbez7465 Před rokem

    Well done. Thank you

  • @JojOatXGME
    @JojOatXGME Před 2 lety

    Is your benchmark with our without warm-up? (That the JVM is slow before warm-up would not be that surprising, I think.)

    • @McCulloughAssociates
      @McCulloughAssociates  Před 2 lety +1

      Hi, great question. Ran the code just as it appears. However, since the code iterates thousands of loops, the respective vm''s "warmed up."
      I also ran the C# code marked as *unsafe* which disables the runtime safety checks. It did not make a huge difference.
      In order to _warm up_ the VM, I think one would have to write an additional layer to run the code shown several times within a single execution.
      Homework!

    • @Speiger
      @Speiger Před 2 lety

      @@McCulloughAssociates Did you use tools like JMH which has warmup included as a separate feature. It would be interesting to see how quick each VM is when they had warmups included.

  • @jsgovind
    @jsgovind Před 2 lety +35

    Newer languages stand on the shoulders of the great languages that preceded them. Java is great and we would not be here in software programming without Java. There would definitely be no C#. Microsoft took a lot of ideas from Java and added their own stuff to make it better and that's how C# was born. Initially, the languages were very similar but they are quite different now because of the effort put into developing it by Microsoft. It doesn't feel like there was enough effort and innovation put into the language after Java gained popularity. For this reason, Java feels quite outdated to me despite being a great language.

    • @fnamelname9077
      @fnamelname9077 Před 2 lety +1

      The only feature that Oracle cares about is backwards compatibility. The newest JVM will still run java applications from a lifetime ago. (Sometimes re-configuration is required.)
      If that wasn't true, Java would already have moved beyond type-erasure. For that matter, look at how long Lombok has been around, before Oracle added records to java.

    • @fnamelname9077
      @fnamelname9077 Před 2 lety +3

      @Jan Krynicky Java's highly-regular syntax is one of its strengths. It's easy to parse - which is why it has such a rich ecosystem of automatic code-generating tools, why it's so easy for syntax-highlighters and debuggers to interpret, why it's always had great linting support. And more than anything - why it's so easy to work on collaboratively, at scale.

    • @fnamelname9077
      @fnamelname9077 Před 2 lety +3

      ​@Jan Krynicky That doesn't make any sense. The JVM is powerful and useful, but Java as a language is a value unto itself.
      The greatest strength of "scripting" languages are that they "just run" - usually incorrectly. But they protect small minds from the psychic violence of being able to tell WTF they've programmed and how incorrect it is.

  • @samsonmayeem8409
    @samsonmayeem8409 Před 2 lety +13

    Having to be a ‘soft’ engineer, this is what I realized. From a C/C++ bg I moved to php and C# in a month for some projects, after a year I started Java and what exactly what you say now is what I got to know after .net5 was being realized. What I can simply say is that Csharp is clean Java.

  • @mohammadalaaelghamry8010
    @mohammadalaaelghamry8010 Před 6 měsíci

    Great video, thank you.

  • @1234567mrbob
    @1234567mrbob Před 2 lety

    Do you have a video comparing Java or C# to Delphi?

  • @calvinkoay1939
    @calvinkoay1939 Před 2 lety +11

    I am a C# fan. Easy to learn syntaxes. Programmers are well 'spoonfeeded' with built-in algorithms and data structures through its rich libraries, which helps speed up function implementations of the app.

    • @kevinstefanov2841
      @kevinstefanov2841 Před 2 lety +3

      which also results in the programmers becoming code monkeys rather than actual software engineers xD

    • @bharathb4803
      @bharathb4803 Před 2 lety +1

      As the world moves to quick implementation, it is better to "package" the backbones and focus on solving business problem!

    • @quelqunderandom6143
      @quelqunderandom6143 Před 2 lety +1

      @@kevinstefanov2841 programming is just assembling legos, some like to do it piece by piece not using anything prefabricated, others wants to make it fast. Thinking of programmers becoming "code monkeys" because they use stuff that has been normalized and simplified to make debugging and writing efficient and readable code more easy is as stupid as saying "people nowadays are stupid prefab users, back in the days I would have built my pc entirely myself"

    • @kevinstefanov2841
      @kevinstefanov2841 Před 2 lety

      @@quelqunderandom6143 and how is that stupid? that's literally what engineering is about - building stuff yourself from scratch. They can call themselves anything they want but not software ENGINEERS if all they do is use prefabricated ready-to-use bs lol

    • @quelqunderandom6143
      @quelqunderandom6143 Před 2 lety

      @@kevinstefanov2841 then go ahead and build your own computer from bottom up, component by component since you are an engineer. Elitism is idiotic, of course as things go on we are gonna move away from low level code, because there is no real need for it 90% of the time

  • @DevlogBill
    @DevlogBill Před 2 lety +1

    Your video helped narrow it down a bit more, thank you. I never touched C# but I played with Java for 3 weeks. At the moment I am 4 months into learning JavaScript. I have time to think about this but I figured in 8 to 12 months from now I would like to learn either C# or Java.
    From what you mentioned in this video could it be said that Java is light weight where C# is overly complex?
    My end goal is to learn one of these languages for backend and mobile. But I don’t want to spend years learning to many technologies or something overly complex, what is your opinion? Thank-you.

    • @vd3598
      @vd3598 Před 2 lety +2

      In my opinion, C# has more features built in, sure. But it does not make it more complex. Moreover, in professional Java development you will likely search for them, but it will be then some third party package implementation or your own boilerplate or even there will be no substitute. You just have more possibilities built in, but core is of the same complexity. Problem is different - I personally like C# much more but there more jobs on Java usually)

    • @victorbukowsky7496
      @victorbukowsky7496 Před 2 lety +2

      If I had to start learning a full language again, from scratch - I would go with C#. So many reasons why! Documentation on C# is FANTASTIC - Microsoft supported official doc.Microsoft site is just everything you could dream of. Visual Studio has all the reference information already built into it - you can quickly look up classes, interfaces and methods you are pulling, directly from within VS. Vast majority of C# programmers are American/Western, so there is massive amount of English speaking forums, and help. While Java is dominated by Indian guys, and so you won't find any good forums in english, at all lol Everything is 3rd party in Java - literally NO documentation, of any sort lolol Maybe some support on the CURRENT versions only, but anything 1-2 years older+, you are totally on your own. Go with C#, if you are in doubt. Javascript by the way, might give you incorrect perception of real programming - JS is not really a full language. So I would advise to quickly move into a good enterprise language, or you might get wrong ideas. Cheers, GL

    • @DevlogBill
      @DevlogBill Před 2 lety +1

      @@victorbukowsky7496 I really appreciate the wisdom. Also, documentation is very important I noticed, perfect example React has really good documentation. Originally I was thinking about Vue but a lot of the documentation is decent. I felt React had better documentation which is why I decided to use this library. Also, I see where your going with learning JavaScript, its a complicated language. Class system is prototypical? it isn't like Java or C#, a class is a class.
      At the moment I had learned the fundamentals and I am learning to work with the DOM now. Once I have a handle on the DOM, CSS- flex-box, and high array functions. I will move onto React. After I have a good handle on React. Finally I will choose C#. Just want to make sure I know the tool kit well before adopting another tool set. But I appreciate your invaluable insight it is much appreciated. I am strongly considering C#. I will revue the documentation for C#, thank you once again.

    • @victorbukowsky7496
      @victorbukowsky7496 Před 2 lety +1

      @@DevlogBill yes, classes in Javascript are just syntactic sugar - meaning they just look like classes, but aren't'. For many reason, because there is no even compilation in Javascript anyway, it's all just interpreted runtime. DOM is great - this your foundation, for entire front end. What DOM really is just the browser object, that you are allowed to work with, using Javascript. But DOM is just an object, written in C++ or Swift for Apple or whatever a particular browser is written in. React - I would advise to wait with it. I know it, it's pretty confusing. If you want to learn front end framework - go with Angular, you won't miss out on that. Much better choice than React. Yes, React is hot, but it's weird, and has very limited niche - it's for highly reactive quick websites. You shouldn't clog your mind with that stuff right now. My advise - finish up with Javascript, maybe go into Angular, and then quickly move into C#. This is where the real programming is, and REAL MONEY is. Job market for C# is very hot, specially in the USA, Canada, etc. I don't know where you are. Skip Vue as well, don't waste time on it. It's junk anyway, I kinda know it - just skip it. Good luck, friend! lol you have a quite a road ahead of you, but it's massively fun. I enjoyed my trip. And money is ridiculous lol Plus freelancing/consulting possibility down the road.

    • @DevlogBill
      @DevlogBill Před 2 lety

      @@victorbukowsky7496 I really appreciate your insight, you give a different perspective on things. What I think is confusing with React is JSX. It looks like JavaScript with HTML plugged into the code break. I hear from some developers that you could learn JSX and React first then jump into the fundamentals. But me personally? I figured it would be much smarter to get a strong grasp on the fundamentals since these libraries and frameworks are constructed for JavaScript.
      I will begin a framework around mid-May. What is the best approach to learn Angular?
      I believe the best approach is to take the entire framework Angular and learn the syntax first. Next learn about the modules and components next. What was your approach with learning Angular? Today I will download the documentation and visit the website to gain a better understanding of Angular.
      Also, I live in NYC so there is a strong market for C#, JavaScript, Java, etc. etc.
      When I check indeed I see jobs for C# but I keep on running into so many jobs for Java. But I noticed something. Most of those jobs from what it looks like I am not sure but it seems they are looking for people to update their back-end or maintain it. I don't see anything mentioned about creating new products using Java.
      Also, I downloaded some plugins for C# into my visual studio code, soon I will look into what is C#.

  • @eng.wandeson
    @eng.wandeson Před 2 lety

    amazing, very good!

  • @torrvic1156
    @torrvic1156 Před 2 lety +2

    Thank you so much for interesting video! You approved that I made right choice when I started to learn C# and not Java or JavaScript (they said it’s easier!). I like how strict C# is and how convenient Visual Studio is. Just a simple opinion of me being noob. Guys! Can you tell me if it’s worth it to learn WPF nowadays?

    • @alexbarac
      @alexbarac Před 2 lety +3

      I guess you could try it to get a hang of using the MVVM design pattern, which is commonly used in mobile development with Xamarin or MAUI.

    • @cmbuffa
      @cmbuffa Před 2 lety

      just learn some frontend framework + .NET in the back, there are tons of work for fullstack developers for example Angular + .NET . Of course you can learn Blazor for example and stay in full .NET ecosystem, but I would recomend you to learn some javascript framework for the frontend as well (Angular, React, etc), and answering your question I wouldn't learn WPF

  • @rolandtennapel5058
    @rolandtennapel5058 Před 2 lety +9

    C# allows C++ inside the code (with the proper compiler settings). I prefer C# over Java, and recently played around with Kotlin for the first time (Android relies on it heavily). They both work, but I found C# just prettier, feels better, makes more sense to me. Java feels like it's somewhere between C++ and C# and with all the 3rd party libraries, I often find myself lost in the maze of different (and often terrible) naming conventions and bad documentation. Kotlin doesn't have that problem (as much), but that's probably for the same reason C# doesn't have that problem (as much); A big and solid enough foundation, support and use by others for the time and effort put into making great documentation. I'm not against Java by any means, but it just doesn't work for me 😅

    • @jongeduard
      @jongeduard Před rokem

      WHAT?? C++ inside the code? Who ever made you believe that?
      You probably just mean unsafe programming with pointers, however that's still far from C and C++. And it's not even a real subset of these languages, since there are multiple fundamental differences as well.

    • @rolandtennapel5058
      @rolandtennapel5058 Před rokem

      @@jongeduard experience made me believe that 🤣

    • @jongeduard
      @jongeduard Před rokem

      @@rolandtennapel5058 Well then you need some more experience, because there are fundamental differences. 😂😂

  • @Nimitz_oceo
    @Nimitz_oceo Před rokem +2

    Hey you should have warned me… That slap got me by surprise.

  • @DevlogBill
    @DevlogBill Před rokem +3

    I know this is probably a horrible analogy, but it almost feels like when you compare C# and Java. It sounds like the same arguments the C and C++ camps debate over. But to be honest? If I had to choose, I think I would go with C# and .NET for the simple fact everything you need is all together under the .NET framework. Java feels all over the place. Don't get me wrong? I like Java as well; they feel like the same language even though they aren't. Basically, finding learning material for C# seems to be so far easier to find in comparison to Java. For example, for Java to set up my environment was such a difficult task. I had to download from Oracle I think they call it an SDK. Next, I forgot what they call it I had to download some file. finally, I downloaded IntelliJ which is a cool IDE and finally when I tried to run Java on VSCode, my code wouldn't run. I found the C# ecosystem a little bit easier to find material to learn from. Also, there are different versions of Java which isn't recommended to use? I found this confusing. For example, what is Java FX? With C# I downloaded Visual Studio and I quickly found lots of material for how to get started and had an easier time figuring things out. At the moment I stopped this, and I am purely focused on JavaScript. But after I learned React, I will pick up most likely Java because of the huge job market. I am in NYC, and I can tell you that from indeed.com there were only 237 jobs post for C# and .NET and over 1,227 jobs post for Java. Despite what my personal feelings are if you want to find your first job you have to go where everyone fishing to catch fish. Sorry for the horrible analogies but I hope you get the point. This is from a newbie's perspective I am not a professional. This was my struggle as a newbie so far.
    Also, I would like to thank everyone for providing me with such insightful advice throughout my learning path. It has given me much needed guidance throughout these past couple of months.

  • @ZeryusXD
    @ZeryusXD Před 2 lety +8

    Don't get worried if people say one language is better than the other. Learn whatever language that is most in demand in your area and after you land a job and gather enough experience and knowledge you can easily jump to any other language as you please

    • @hanswoast7
      @hanswoast7 Před rokem +1

      Pro tip: Start with BrainFuck ... then become a barista :D

  • @DevlogBill
    @DevlogBill Před 2 lety +1

    Hi McCullough, I know Java and C# are both OOP languages but the language I am learning at the moment JavaScript isn't? JavaScript is prototypically written. I find this very confusing. What exactly is prototypical? Would this hinder my learning or understanding of what real OOP is in comparison to Java or C#? Which is real OOP? I am at the stage where I understand the fundamentals and I am trying to learn more advance topics with JavaScript like recursive functions and gain a better understanding of pure functions versus class-based functions. Eventually I will migrate to either Java or C# for a back-end language. I am trying to learn JavaScript on a deep level so that I am able to better understand other languages with better ease when I move onto the next one. Or would it be best if I gained a deeper knowledge of languages like C# and Java versus learning from a prototypical language like JavaScript since Java and C# are true OOP languages? What would be your recommendations? Thanks McCullough most appreciative.

    • @McCulloughAssociates
      @McCulloughAssociates  Před rokem

      Great question. But the answer is a little tough to elaborate in a comment! For basic stuff like loops, conditionals and functions, conceptually similar. I think strongly typed vs untyped JavaScript is as big a hump as perhaps the object oriented features. Remember, ultimately everything executes machine code using memory, cpu, and IO.
      I have several videos on SOLID design- take a look. They might shine some light on OOP concepts

    • @DevlogBill
      @DevlogBill Před rokem

      @@McCulloughAssociates OK, I will check out your videos on solid design. I think I may have heard of solid design with C#, sounds interesting, thank you for the direction.

  • @nelsonthekinger
    @nelsonthekinger Před 2 lety

    Very cool video

  • @CouchPotatoWizard
    @CouchPotatoWizard Před 2 lety +3

    I wouldn't mind a deep explanation of checked exceptions and why they are an anti pattern.

    • @McCulloughAssociates
      @McCulloughAssociates  Před 2 lety +9

      Think of it this way - exceptions (c++) replaced return codes. Return codes required each function on the call stack between the error and the handler to recognize and propagate the error. Lots of points of failure. Exceptions allow the thrower and the catcher to be the only code to be exception aware - everything else is exception illiterate. Forcing each method to declare a throw puts us back into the return code paradigm.
      In practice, error conditions are usually considered in later iterations. An error detection would occur in lower level code whilst handling in application layer code. One would have to modify all of the code inbetween with the throw declarations. Take HttpServlet as an example. The doXxx methods all throw Servlet and IO exceptions. A subclass probably invokes other methods that might throw SQL exceptions. The override can only throw the declared exceptions. Many developers make the mistake of catching and dumping the SQL exception. The right answer is to catch and rethrow one of the declared exceptions or runtime exception. This is just more code where mistakes can be made. If the exception were just a runtime (unchecked) to start with, maintenance would be much easier because the middle code wouldn't have to deal with it. This is why the DispatcherServlet in Spring catches checked exceptions and rethrows runtime exceptions - so that the application code doesn't have to get boxed into throw decls.
      Stroustrup cites a similar scenario to justify the change in C++ 11 to have the compiler ignore exception declarations. It looked good on paper, but in reality, exception declarations on function signatures caused more harm than good.

    • @Android-17
      @Android-17 Před 2 lety

      @@McCulloughAssociates wow. Thanks!

    • @eugenpaval
      @eugenpaval Před 2 lety

      @@McCulloughAssociates great explanation! I recall the war between proponents and opponents of checked exceptions when they were introduced

  • @bariole
    @bariole Před 2 lety +8

    Sun's Java, like the referent one, has been running generational GC since late nineties. Technically speaking, GC is not mandatory part of JVM, and varius JVM implementations have completly different GC algorithms at any point of time. Being "generational" is also not a significat benefit or a failure, as implementation details are far more important than "generational", "copy", "segmented", "precise", "stop-the-world", "realtime" or whatever else comes.. Also for running server code, the most important aspect of GC, is ability of allocator to reuse unused "holes" within memoryspace as not using those leads to memory leak because of fragmentation. A classic C problem. The remedy for that is usually "copy collector", or in modern times, segmented one. Many "generational" GC algorithms are often also "copy collectors", but they don't have to be.

    • @iXPilot
      @iXPilot Před 2 lety

      I have a feeling, that Chuck maybe was confused by G1GC because it is complicated and it was in development for a very long time, or maybe by J2ME due to it's difference in memory management or maybe by difference between "server" and "desktop" versions of JIT compilers (I actually don't know where else that "desktop" idea could came from)... But anyway, this part of the video could be better: I work with Java and I see evolution of the GCs: first it was CMS, then G1GC and now Shenandoah so I'm curious how it's going in the .Net world, especially after seeing the failure of Go's GCs, but eh...

  • @miansherry6453
    @miansherry6453 Před 2 lety +1

    Superb.....

  • @RiversJ
    @RiversJ Před 9 měsíci +1

    You Can make pretty blazing fast applications in C#, but it's no magic bullet you'll need to put in the same effort into the code and algorithms as you would in a lower level language to achieve it.

  • @bigbilly29
    @bigbilly29 Před měsícem

    Thanks Chuck

  • @L1ghtOn3
    @L1ghtOn3 Před 2 lety +7

    If It wasn't for Java I probably would have gave up programming as I hated C at Uni. Then Java doing android games got me interested in game engines so Unity and C# never looked back since! A sprinkle of Html/css/js, tiny bit of python but don't get the hype and I use some C++/Blueprints on UE4/5, but C# is my fav language...so far will take something special to beat C# for me anyway. ✌

    • @FilipCordas
      @FilipCordas Před 2 lety

      Python is the worst language, it's like a worst version of Javascript and Javascript has gotten much better in recent years. The whole point of the language is to be needlessly complicated so academic types can pretend they are smarter then everyone because they write unreadable code.

    • @L1ghtOn3
      @L1ghtOn3 Před 2 lety

      @@FilipCordas I agree JS has gotten better especially after ES5/6, I like flow but prefer Typescript obviously coming from C/C++/Java/C# background. I made a Django ecommerce project and I just did not get where things were coming from and I just felt why do people Love Python? Because it has less code? Ì think as well def__init__(self) I just don't think is very intuitive coming from a different language, not a fan of looking at __init__ calling a function def and having(self). There are parts of Python I like others I dont, Var everywhere can lead to problems fast and Django I just can't see me using it again, I did however like the built in admin. I really have yet to come across my no.1 server side framework. I'm toying with Express, made some simple asp. Net sites nothing large. I have done some simple php stuff too but not yet full done a full laravel project, I will after express. Ive read some Golang its interesting. I might even do a Spring project as well. ROR I just feel it will be a mix of Python/JS, could be wrong and might try that as well, but my main thing is games so only do web now and again mobile not so much anymore. But yeah I hear you with Python, the scripters love it fir automation on Unix systems along with bash. Thats prob why its popular plus its recommended as starting language and a lot never leave it.

  • @ProjectVastness
    @ProjectVastness Před 2 lety +5

    I'm a 40 years old guy that started on C, Cobol, Turbo Pascal, and later a little of C++, and yes languages with { } are very welcome to me. I learnt a little of Python, Haskel, Scala, Julia in the last years. I'm currently working in Cybersecurity, and python - c/c++ - bash for me are very useful.
    But I always wanted to learn c#, (we can do some pentest with it also) even though for me is very "confusing" "using so much text" to do something simple like a loop countdown to type a hello world for example. It messes my head that amount of typing. 🤣🤣🤣
    One language I tried recently and I loved it was F#. I hope you can teach a little of it also. Thanks for explaining things so well, got a new subscriber.
    Ps - About performance , if I want performance c/c++ simple as that. Between java and C#, I would prefer C# to learn. Many years using Visual Studio, love that IDE or even the one made by Embarcadero company (to use with c++) 👌👌👌

    • @Michal_Peterka
      @Michal_Peterka Před 2 lety +2

      I love F# too - especially piping and discriminating unions

    • @RustedCroaker
      @RustedCroaker Před rokem

      Try Java with IntelliJ IDEA and VS will fills like a glorified notepad with random set of outdated tools after that.

  • @mahkhi7154
    @mahkhi7154 Před 2 lety +1

    Java was designed for Internet Applets. The Windows Team wanted it for Business Apps. It catches errors better than C++.

  • @kamilziemian995
    @kamilziemian995 Před 2 lety +3

    Good video.

  • @majahanson311
    @majahanson311 Před 3 měsíci

    If a developer asked me which the learn, one of my first questions would be what kinds of companies do you want to work for? If you want to work on line of business apps in established companies, C#. If you want to work in west coast startups or big tech, Java. I definitely like the C# language and tool stack better, but because C# started out life as Windows-dependent, Java ended up dominant in cultures that didn’t want to depend on Windows. Thankfully the dependency went away, but the inertia from that history remains

  • @wheresmyclicker
    @wheresmyclicker Před měsícem

    Does the dotnet vm take less time to spin up than the jvm?

  • @osanbrazil999
    @osanbrazil999 Před 11 měsíci

    The funny thing is all that semantic abstraction turns out to be just bytes that were put in memory in a logical arrangement wich are sequentially read by the CPU wich reacts to them in a certain manner depending on their values and, in turn, outputs signals in certain ways as to control devices such as video cards, sound cards etc. so that we can see or hear the result of all that and use it to our advantage. LOL.

  • @distant6606
    @distant6606 Před 2 lety

    im pretty sure they ve added records in later versions of the jdk

  • @ITrustInDog
    @ITrustInDog Před 2 lety +2

    Java doesn’t support unsigned numeric types which can be a rather significant omission depending on the application requirements

    • @lufenmartofilia5804
      @lufenmartofilia5804 Před 6 měsíci

      To be honest, yes it's not buildt in, but you can easily get them using an "extended" std library such as Guava or Apache Commons

  • @HollowKrin
    @HollowKrin Před rokem +1

    Kotlin worth to be compared too! It's very similar to both of them.

  • @MidnightSt
    @MidnightSt Před 2 lety +14

    "Is C# better than Java?"
    Yes. I stand by how I describe it, that being: "C# is what Java would have been, if Java creators, before creating it, stopped to think: 'How do we design this language so that it makes sense and it's not shit?' "

    • @sylvereleipertz955
      @sylvereleipertz955 Před 2 lety +1

      Sounds very salty from someone enjoying a copy paste langage version of Java 🤣

  • @Qrzychu92
    @Qrzychu92 Před 2 lety +4

    Great video, but there is one thing missing here - comparing the project structure. In modern C# you have 5 lines in a csproj for, and you already are able to build, run and debug the program both by running "dotnet build" command, and in Visual studio.
    For Java, at least in templates, it's by far way more complicated. First of of all, you need to know me syntax, groovy (while everyone knows basic XML). Secondly, you cannot use javac, if you want to have any maven dependency, you need Gradle to compile.
    Please, correct me if I'm wrong, but I tried to replicate few programs in Java to compare them myself and got stuck at the setup part - I just wanted single Java file with ability to add dependencies and to be able to F5 debug in InteliJ. Never got there, either in Java nor Kotlin, just a simple console app. I admit, it was only one evening of trying, but in other evenings I managed to setup Zig, Rust, node.js, Go without any issues

    • @inohope
      @inohope Před rokem

      @@ThiagoPagogna What's the point in wasting time on that?

  • @tordjarv3802
    @tordjarv3802 Před 2 lety +3

    Just a correction, Java recently added records.

    • @McCulloughAssociates
      @McCulloughAssociates  Před 2 lety

      Yeah, we produced this prior to J18 release

    • @tordjarv3802
      @tordjarv3802 Před 2 lety

      @@McCulloughAssociates I suspected as much, and that is totally fine. Both languages are still evolving allot so a statement that was true a moment ago is not necessarily true now. Anyway I found your video to be very informative and provides a good overview of either language. Keep up the good work.

  • @giulio7288
    @giulio7288 Před rokem

    Can you make a video on JavaFX vs WPF ?

  • @DK-ox7ze
    @DK-ox7ze Před 2 měsíci

    Please do a similar video comparing both languages to Javascript/typescript.

    • @McCulloughAssociates
      @McCulloughAssociates  Před 2 měsíci +1

      Will do!

    • @DK-ox7ze
      @DK-ox7ze Před 2 měsíci

      @@McCulloughAssociates Looking forward to it. Will be great if you can do two separate videos comparing JS to each.

  • @Larry821
    @Larry821 Před 2 lety +2

    After many years of C#, I thought it would be a cakewalk to work in Java. After all, they are virtually identical languages aren't they?? NO!!! I had a very tough time trying to actually work in Java. There were numerous technical quirks and annoyances that were difficult for me to surmount. I gave up!!

  • @elviskimara4929
    @elviskimara4929 Před rokem

    great video

  • @jangerman
    @jangerman Před 2 lety +1

    The best thing Java has going for it is how relatively easy it is to port to C# ;)

  • @bronzekoala9141
    @bronzekoala9141 Před 28 dny

    I wonder why chacked exceptions are a bad Idea? Because without being a Java Dev, it sounds really great. It always bothered me in C# that you never know when a method could throw.

    • @McCulloughAssociates
      @McCulloughAssociates  Před 24 dny

      It is good in theory, but in practice it can be a problem.
      Think about the HttpServlet class in Java. To create a servlet, one must subclass and override doGet, doPost, etc. The superclass methods declare throws ServletException and IOException. These must be replicated in the override. However, most developers will access a database that throws SqlExceptions. Now the developer must try/catch those. A common programming error is to simply ignore the error, leaving the application in a 'good' state even though the operation failed. The correct move is to rethrow a runtime or servlet exception with the original nested. This clutters up the code and doesn't add any value.
      Code that can really handle the exception probably doesn't care what the problem is. It will simply log the error and redirect the user to a sanitary error page. Having all the layers of code in between have to be exception aware defeats the purpose (essentially becoming a return code that has to be propagated)!
      Bjarne Stroustrup explains the reasoning for dropping the feature in C++ 11 by saying after decades of use, most applications handle all exceptions the same way near or in main and all the exception declaring just made everything more cumbersome and error prone.

  • @marna_li
    @marna_li Před rokem +2

    C#/.NET has delegates (type-safe function pointers) whereas Java doesn't. Java's generics depend on Type Erasure, where a type parameter is essentially stripped when compiled, but .NET is completely aware of what type a parameter is at runtime. A List is a List at runtime.

  • @kirkshammett94
    @kirkshammett94 Před rokem

    I’m a complete beginner and about to start school for a bachelors in software engineering. I have the option to choose a Java or c# route. Anyone wanna help me on what to choose? I’m so torn about which one!

    • @McCulloughAssociates
      @McCulloughAssociates  Před rokem

      Either. Learn both, and c++. The language isn’t the issue. Languages come and go. Be above it.

  • @jaymartinez311
    @jaymartinez311 Před měsícem

    the fact i can do this similar to js/ts makes me pick c#:
    var foo = new {
    // Some object props
    }
    Thats just one thing without a LinQs example or any of that and C# 12 is on another level.

  • @zekeluther
    @zekeluther Před 2 lety +2

    this channel will growth subscriber blazingly fast

  • @andym2723
    @andym2723 Před 23 dny

    The power of Java is it’s JVM. You need traditional programming there is regular java. You need a cloud oriented solution for fintech there’s scala. You need rapid prototyping on the web there’s groovy. When I say web I refer to traditional web pages on the internet not intranet applications. You need RPC front end solution for front end web there’s GWT or Vaadin. Kotlin for mobile applications.

  • @MarcLucksch
    @MarcLucksch Před 2 lety +1

    I am really missing async/await in Java

  • @Asdasxel
    @Asdasxel Před 2 lety +2

    It seems like you are doing this comparison with an old version of Java. There is another type specifier that you said is only in C#, Record. BTW Enums in Java are much better than in C#. And when mentioning Linq, you could have also shown Streams. The way it is done seems a tiny bit biased.

    • @McCulloughAssociates
      @McCulloughAssociates  Před 2 lety +3

      Thanks for your comment!
      Yes, latest version of Java 18 has records. The video was produced before the release of J18 in March 2022.
      Our original script included a mention of Streams in the Linq topic, however, it was cut because Streams only apply to collections and files while Linq can also operate on data sources (relational databases) and includes a query language.

    • @Asdasxel
      @Asdasxel Před 2 lety +1

      @@McCulloughAssociates Thank you for finding time to answer. I like the video, I just wanted to point out a few inacuracies I noticed.
      About the Records thing, Records were part of the Java 14 release in 2020 as a preview feature and then released fully in Java 16 a year later. Java is releasing new versions very often these days so I understand that it is easy to miss new features. It's probably a good idea to use the current LTS version for these kind of videos.

    • @eugenpaval
      @eugenpaval Před 2 lety +1

      @@McCulloughAssociates plus there is no syntactic sugar for streams. In addition Linq will operate on any IEnumerable or IQueryable. Plus there is now IAsyncEnumerable also a target for Linq. I am not aware of anything similar in Java

  • @haroldpepete
    @haroldpepete Před 6 měsíci +1

    i think java's remained current thank to spring, spring is used in a lot of big companies and it's a great framework, i would say the best in the industry

  • @dsuess
    @dsuess Před 7 měsíci +3

    C# > Java
    (oops forgot.. subjective warning applied)

  • @freecash3474
    @freecash3474 Před měsícem

    thank you ton

  • @TheRealXartaX
    @TheRealXartaX Před 29 dny

    I think it would be more useful if you kept both the C# and Java syntax on screen at once so you can visually compare them. Instead of "transforming" the code into the different language, so you have to rewind to check the previous syntax.

    • @McCulloughAssociates
      @McCulloughAssociates  Před 24 dny

      Thank goodness for pause and rewind!

    • @TheRealXartaX
      @TheRealXartaX Před 24 dny

      @@McCulloughAssociates "Thank goodness for crutches, now you don't need that leg surgery".

  • @henfozhu1064
    @henfozhu1064 Před 2 lety

    讲得有道理