Hello!

I just wanted to make a post to share my excitement over discovering programming with Java. For context, my previous knowledge of any programming language barely extended into classes as I always struggled with understanding more than the basic basic things (classes? like what you wear on your face? get and set what? the table?).

I really liked the idea of programming though! So over the years (maybe 15-20?), I tried learning (and failed) with different languages, hoping something would help things click. I’ve tried C#, Basic, JavaScript, HTML/CSS and more but never Java. As to why not, I have no clue.

The reason for Java, now, is that I’ve been playing Minecraft a lot recently (my adhd thanks you Mojang) and I figured, why not give it a try? So I started a free online course covering the basics: variables, methods, objects… A week later, and after a lot of DuckDuckGoing, I now understand not only the basics but classes, IO, exceptions, and so much more! I’m currently wrapping my head around Generics but I’m having a wonderful time with it. After that, who knows :)

Take care and thank you for reading!

  • Timwi@kbin.social
    link
    fedilink
    arrow-up
    16
    ·
    10 months ago

    I applaud your success! I’m curious though: what is it about C# that made it inaccessible compared to Java? The two are extremely similar, so much so that I think you’d have to learn for more than a year before you start noticing any differences.

  • dust_accelerator@discuss.tchncs.de
    link
    fedilink
    arrow-up
    14
    ·
    10 months ago

    Virtual high five! Keep it up, I’m always happy to see someone find joy and a sense of accomplishment in programming things.

    Check out polymorphism and concurrency when you feel you’re solid enough on the other things. Concurrency/threading can be a bit weird to wrap your head around, but essential to build powerful things. (See Reader-/Writer problem to start)

  • RobertoOberto@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    10 months ago

    Nice work!

    Without formal a formal education program, finding the right subset of a new skill or hobby is probably the best way to hook yourself in so it’s easier to keep at it long enough to really start learning. It sounds like concepts are finally sticking for you because you have an immediate and fun application for them.

    I hope more people continue to find unconventional paths into the field like you did, keep going with it.

  • agent_flounder@lemmy.world
    link
    fedilink
    English
    arrow-up
    6
    ·
    10 months ago

    That’s kickass, way to go! Online learning is the way to go. I have a hard time learning stuff directly from a book (ADHD may be why idk). Something about the structure and pace and external motivation of a course does the trick for me. That’s how I learned AngularJS, anyway. All kinds of stuff you can do with Java: Desktop apps, web apps, etc etc.

  • pcouy@lemmy.pierre-couy.fr
    link
    fedilink
    arrow-up
    5
    ·
    10 months ago

    Do you mind sharing links to the courses you found ? I’ve been teaching Java to students who almost never wrote code before, and I’m always looking for beginner-friendly resources I can recommend to them.

    • SendMeYourTaTas@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      3
      ·
      10 months ago

      Sure! The course that finally worked for me is at Codecademy. I’m only doing the free content but it’s broken down in ways I can understand, with immediate examples after the explanations. It has you create a small program after each short lesson and keeps slowly building up. There are hints for each task as well, which has helped me tremendously as well.

      It reminds me of freeCodeCamp’s courses, but for Java. It’s also not so wordy (no offense to FCC), which is great for keeping my focus on the content.

      I’m currently on the ‘Learn Intermediate Java’ course but I started with the ‘Learn Java’ course.

      https://www.codecademy.com/learn/learn-java

      • pcouy@lemmy.pierre-couy.fr
        link
        fedilink
        arrow-up
        2
        ·
        10 months ago

        Thanks for the detailed answer about your learning experience and for the link 👍 ! I’ll make sure to check it out.

    • Serinus@lemmy.world
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      10 months ago

      If you teach them factories in tyool 2024, I swear I will find you and I will take away every color compiler and runtime you have outside of Radio Shack Level 1 BASIC (TRS 80).

      • pcouy@lemmy.pierre-couy.fr
        link
        fedilink
        arrow-up
        1
        ·
        10 months ago

        I am not an actual teacher, I only supervise practical computer science work aside from my dev job, so I have no saying in what is taught. But don’t worry, this is only a very basic introductory course, no factories, not even inheritance. Only classes, attributes and methods.

  • thepiguy@lemmy.ml
    link
    fedilink
    arrow-up
    4
    ·
    10 months ago

    That’s great to hear! Always nice more new programmers. Minecraft modding is great, and it also provides you with a platform with a lot of reach and a lot of really amazing devs willing to help. My most successful project to date has been a simple Minecraft mod. Keep it up and good luck on your modding adventures!

  • aluminium@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    10 months ago

    Very cool. Thats in a way the beauty of Java. It offers you just enough Tools for Object Oriented Programming to get everything done in some way (maybe not the most elegant or efficient way, but in a way).

  • elxeno@lemm.ee
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    10 months ago

    I never got the point of using classes from tutorials, all those animals/cars/person examples were utterly useless to me, but then i started writing C++/Qt and then Flutter and i think i got it…

    • swordsmanluke@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      10 months ago

      Classes are Data plus the code required to modify that Data. The idea is to encapsulate data modifications into one thing (a Class) that knows how to modify all the Data as a single unit. This lets us write some code to describe, say, a Scrollbar widget. The Class for the widget combines all the Data for a Scrollbar (position, orientation, bar size, total size, etc) with the methods that read or modify that data (scroll up/down, change size, draw, etc).

      That’s the first Big Idea of OOP - that data should be grouped with the functions that modify it. If you don’t have that - as in C - you have to write functions that only work on a given data type but which are namespaced separately. You get functions like void set_scrollbar_pos(void* scrollbar, word pos) which become verbose in a large project. (I’m not saying this is the worst thing in the world, just a different style.)

      The second Big Idea of OOP is message passing. Now that we have code and Data bundled together, it would be nice if Objects that share functions of the same essential type and intention could be swapped out interchangeably. So instead of directly invoking a function on an Object, we send a ‘message’ that says something like ‘if you know how, please draw yourself on screen, relative to X,Y’.

      Of course, since plain English is hella verbose, the actual message is going be something like “draw, X,Y” and the Object receiving the message then sorts out if it has a method called “draw” that can use the provided X and Y. If so, it runs the code to do so. If not, you get an error.

      Messages like this mean that you can swap out compatible Classes for one another. E.g. you can ask any collection of widgets to .draw themselves with a single method and let the compiler/interpreter generate the machine code as needed. That reduces the amount of boilerplate for engineers by a lot! Otherwise, trying to work with any collection of heterogeneous Objects (like a List of every Widget contained in a Window) would need to have essentially the same code rewritten for every different Type needed - a combinatorial explosion of code!

      Tl;Dr -

      • Classes help organize code and simplify state management by combining data with the functions that manipulate that data.

      • Classes reduce the amount of boilerplate code needed by allowing methods with the same “shape” to be called interchangeably.

      Everything else about OOP is essentially built off these two ideas. I hope that helps.

  • sloppy_diffuser@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 months ago

    If you are interested in pushing more, there are other JVM languages.

    Scala was my first functional programming language after doing Java -> Groovy -> Scala. All 3 can access the entire Java ecosystem and are compatible with each other. Scala is like having Generics for your Generics (Higher Kinded Types).

  • moormaan@lemmy.ca
    link
    fedilink
    arrow-up
    1
    ·
    9 months ago

    Congrats! Java is a good language to learn, and it’s gotten a lot better over the years. The tooling and the ecosystem are very mature. Enjoy your newly found super powers!

    • abhibeckert@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      10 months ago

      Java’s not my favourite language either, but the only “nice” language on his list is C# and particularly if he was using it in a .NET context then it’s got a steep learning curve:

      var builder = WebApplication.CreateBuilder(args);
      var app = builder.Build();
      
      app.MapGet("/", () => "Hello World!");
      
      app.Run();
      

      Working with closures and run loops is a pretty rough starting point compared to other languages where you start with just print "Hello World". Those concepts are relatively simple for someone experienced but a beginner can easily hit a brick wall they can’t climb over.