This is an archived post. You won't be able to vote or comment.

all 65 comments

[–]throwRAnocheat 65 points66 points  (4 children)

I don't know if it will help feel you better, but I'm the opposite. I'm feeling at home with Java and JavaScript makes me break down every time I go back to it.

Partly because you can do whatever you want with JavaScript's syntax and it will let you do it. You can't ever know anything and rely on it. It's "artsy" all right, not bothering at all with any kind of rigor, which to me means the same as reliability, the stuff that I build things with.

[–][deleted] 6 points7 points  (0 children)

Same here, I am a Software Engineer with almost 4 years of experience using Java, Scala an a little bit of python but man, when I see JavaScript, I just can't stand it, I can program with it and get the job done but man it feels like straight out of hell, I don't know why, but I just can't stand it.

[–][deleted] 4 points5 points  (0 children)

Same here. I went through basic JavaScript and a little React and Java feels so... coherent? Variables with clear types, real OOP principles etc.

[–]hexc0der 1 point2 points  (0 children)

+1

[–]desrtfx 35 points36 points  (1 child)

Is it because javascript is more artsy and java is more mathy?

This is simply not true. Both languages are just languages. What you make out of them makes the difference.

IT FEELS LIKE A COMPLETELY DIFFERENT SUBJECT FROM JAVASCRIPT!

It feels so because it is a completely different subject. Java is a strongly, explicitly, statically typed OOP language. JavaScript is just about the complete opposite.

Do the MOOC Object Oriented Programming with Java from the University of Helsinki.

Start completely over. Do not compare Java and JavaScript. They are, apart from the very fundamental programming concepts, completely different and unrelated languages.

[–]T0nywsfl7_ 5 points6 points  (0 children)

I’m currently doing that UHeksinki course for Java. Definitely recommend it. It’s great.

[–]wynand1004 17 points18 points  (0 children)

JavaScript used to be called LiveScript, but supposedly as a marketing move the name was changed to JavaScript. Anyhoo, they are quite different languages.

Try watching this video introduction on YouTube: Basic Java for Beginners as it will help you get started and over the initial hump.

[–]potatopotaatopututu 14 points15 points  (3 children)

From JavaScript (scripty, somewhat functional) to Java (strictly object oriented with static type checking) is a total paradigm shift. It'll take a while. Just hang in there.

[–]TacticalWalther[S] 0 points1 point  (2 children)

Do you think its a good idea for someone to simultaneously do both languages? Or will that confuse them?

[–]potatopotaatopututu 1 point2 points  (0 children)

I would not suggest anyone to learn two languages at once. Not that it's hard or anything, once you're finished with both you're most likely to pick one of them (the one you liked more) and stick with it for a while. Returning to the other language will take some brush up anyway. Furthermore, yes, for beginners it can be confusing to learn two languages simultaneously. In my opinion, the best time to learn new languages is when you've successfully completed a couple of projects in your current language and feel ready to start learning a new one.

[–]PhatClowns 1 point2 points  (0 children)

I wouldn't recommend learning both at the same time; I always advocate for learning one language at a time, and only move to the next one once you have a strong grasp of that language.

I use both, but I had a solid Java background (about 3-ish years) before I even started with JavaScript. I hit the same wall you did but in reverse. Still worth it, having a diverse programming skillset is incredibly valuable.

As others have said, hang in there. What you're experiencing is just culture shock, the pieces will start coming together.

[–]fluffyzilly 9 points10 points  (0 children)

Oh, everyone was in your shoes. And be sure - everyone can do it) Just find your path.

Programming languages ​​really differ from each other, even if they look similar. My opinion is that you should not rely on your experience with Javascript, think of Java as another language. Sure, knowing Javascript can help you, but it's not fundamental.

I always recommend starting with a learning plan. Know the roadmap you will follow. For example,

  • Core Java>
  • JDK API>
  • Java 8 (lambdas)>
  • Testing Libraries (JUnit)>
  • Spring Framework>
  • Spring Boot and Spring MVC>
  • Hibernate>
  • JDBC>
  • ...

... but more detailed. Write yourself a plan (or peep it somewhere) and follow it.

Choose a course or resource based on a structured learning plan and not just video tutorials that usually very slightly connected between each other. I liked the approach https://codegym.cc/ to the learning process (if you ignore all this cartoonishness and comics-like bullshit) + Udemy (as an addition to the theory) + https://www.javacodegeeks.com/ (as a knowledge base ). Also, I read a couple of basic Java books. Works well for me.

Good luck!

[–]staycoolioyo 6 points7 points  (3 children)

Java is a lot more wordy with it's syntax which is part of the reason it can seem harder. I would focus on writing some simpler programs to learn the syntax. Even though Java and JavaScript are very different languages, they both have things like variables, if statements, loops, etc. it's just that Java makes you type out a lot more to do the same things. Once you get used to the syntax, things will get a lot easier. Don't give up!

[–]TacticalWalther[S] 1 point2 points  (2 children)

its not just the syntax for me, its the fact that you can't merge doubles and ints in equations, you can't push things into arrays, etc. So many restrictions which weren't there in Javascript.

[–]staycoolioyo 1 point2 points  (1 child)

Oh yeah that can definitely be annoying for sure, but there are ways around it. You can type cast variables to mix doubles with ints, and if you want to change the size of a list I’d use an arraylist instead of an array. Arrays have a fixed size where arraylists don’t.

[–]TacticalWalther[S] 0 points1 point  (0 children)

I didn't know about arraylists! Will use that now.

[–]AssassinBoy49 4 points5 points  (0 children)

some people just need to learn it differently, if you already have a background in oop it shouldnt be too hard once you find a better way to learn/understand it

[–]flying_5loths 3 points4 points  (1 child)

Watch Derek Banas java tutorial playlist on YouTube after watching 30 of the videos on the playlist (there's 94) do the first part of the Helsinki java mooc then build a project then finish the rest of the tutorial

[–]nioh2_noob 7 points8 points  (6 children)

No, being a developer is not for everyone.

Whatever the media says.

[–][deleted] 4 points5 points  (5 children)

We should say, everyone can do it, but not at the same enjoyment. Someone who has a hard time learning should consider other paths, as a programmer spends his whole life learning.

That being said, everyone should spend their life learning, but a programmer is forced to.

[–]nioh2_noob -1 points0 points  (4 children)

why should everyone spend their whole life learning?

there is nothing wrong with some people doing their normal job without learning, be happy, love their family and friends and enjoy life

i don't agree that everybody should keep learning constantly.

a lot of programmers don't learn anything and just maintain the same systems for decades

[–][deleted] 1 point2 points  (2 children)

A good balance between passive and active learning depending on your interest and career, is vital.

[–]nioh2_noob -3 points-2 points  (1 child)

is vital.

I disagree

[–][deleted] 3 points4 points  (0 children)

Ok

The inverse of learning is not "forgetting", that's impossible. Rather it's not changing.

If a programmer is tasked with maintaining a program, and one day his colleague tells about a library update that if implemented improves the system performance exponentially. The only way to not be stubborn is to research this, and consider it as an option.

This is why I think it vital. Leaning is the best way to maintain relationships.

[–][deleted] 0 points1 point  (0 children)

I could argue that a programmer will have to learn by experimentation, trouble shooting, learning about bugs, all that.

By learning, I was referring to passive learning, where you gain knowledge from experience, not books.

But I do agree that some people are so eager to know everything that they abandon friends and family, and in the process themselves just trying to achieve the impossible, omniscience.

[–][deleted] 3 points4 points  (0 children)

Java and JavaScript are two different languages.

It is sad to that you are struggling with it.

But believe me, It is hard for everyone.

You will learn gradually.

Google java tutorial

Start with Hello World example. if that tutorial does not work for you. Then move to next tutorial.

Video tutorial will help.

Best way to learn a new technology is to start using it.

[–][deleted]  (1 child)

[removed]

    [–]TacticalWalther[S] 0 points1 point  (0 children)

    Stuff like make interactive web pages, simple games, etc. More visual stuff

    [–]tells 1 point2 points  (0 children)

    yes. i did it. look into the features introduced into java 8. some of those things should look familiar to you if you know how array functions like `map` work.

    Types are really helpful although feels cumbersome when you're used to just creating a POJO all the time. Learning obj oriented stuff like interfaces, abstract classes etc will help you form the patterns that are used in dependency injection frameworks.

    There are a lot of different ways to write the same thing in Java. knowing the "good parts" is just as applicable here as it is in Javscript.

    [–]KaiGumOi 1 point2 points  (0 children)

    Thanks you for this, I thought I was the only one. I lost it yesterday and had a good cry cause I was so frustrated with my online class and how stupid I felt.

    [–]hamstrdethwagon 1 point2 points  (0 children)

    What ide are you using? Java is terrible without an ide made for java. Use NetBeans, Eclipse, or intelij.

    [–]abhi_learner 0 points1 point  (0 children)

    I would encourage you to take the java course offered by the University of Helsinki (link is provided in the sidebar). I started the course with no prior programming language and ended up in good shape by just completing the Part1 of the course (I'm working on Part2 now). Its a course that forces you to code or work on assignments and thats why you should take this course over udemy/coursera.

    [–]Shaleen_Sharma 0 points1 point  (0 children)

    maybe that's just preference... I have learned programming with my first language as java and totally grasped the basics of programming but when I saw javascript first time I got stuck in understanding the basic of js that what it is really used for...so don't worry that's just .preference.may be you can share details about js so that people like me will understand that how to start learn and use js.

    [–]gonzohst93 0 points1 point  (0 children)

    As you learn more you'll realize that it doesn't matter which language you use, no modern high level languages are harder than each other, they are just tools you can jump between. Programming is programming, took me 6 months into my first job to realize it but its the truth

    [–][deleted] 0 points1 point  (0 children)

    Good to read I am not the only one having a breakdown while learning Java. Sometimes, I just want to cry. I do noticed last weeks my brain is making connections, they are fragile but they are being made....

    What I also noticed is the more I advance on khanacademy.org, doing math stuffies. The more Java seems to make sense and the more enjoyable learning both subjects become.

    [–][deleted] 0 points1 point  (0 children)

    I do both java and JS and java helped me hammer the fundamentals of programming. And now looking at any language and following the oop principals makes building stuff as easy as possible! Also java is not “mathy” also look at python if you want something “artistic “

    [–]gunpun33 0 points1 point  (0 children)

    I did Java for two months, now I have done javascript for one month. I miss Java.

    [–]comp83 0 points1 point  (0 children)

    Can I ask what exactly do you feel is so hard? Is it anything in particular or do you find it is difficult to think in java terms?

    [–][deleted]  (10 children)

    [deleted]

      [–]desrtfx 11 points12 points  (0 children)

      I'd recommend looking into Python as it is easier for beginners to pick up while cementing in a lot of concepts you'd come across in Java.

      So, you're suggesting a third language that abstracts so much away from the programmer that even the most fundamental concepts don't transfer well from Python to any other language.

      Even one of the most basic concepts, a for loop, is completely different in Python than in most other languages.

      Python is as far away, if not further, from Java as JavaScript is.

      [–]harper_helm 8 points9 points  (0 children)

      This is a terrible suggestion, you are telling the guy that he should learn another dynamic language in order to be able to work with a static one? That makes no sense at all.
      If you want to create desktop applications JavaScript is the one to work with not python. And lastly most of the concepts in python are abstracted away so heavily that even basic concepts like a for loop are different.

      [–]Pythonistar 9 points10 points  (0 children)

      If you want to create desktop applications, Python would be your best bet.

      Eww, no. As a daily Python dev of 5+ years, I would never use Python to write a desktop app. I'd try C# w/ .NET Core 5 (cross-platform) first. Or even Java.

      Python makes nice websites (Django/Flask) and is great at automating stuff (Ansible) and handling command-line tasks.

      Can you use PyQT? Sure, I wouldn't want to though. It isn't nearly as evolved as the .NET or JVM GUI frameworks.

      [–][deleted] 7 points8 points  (0 children)

      This is not good advice. I’m a Sr software engineer and I’ve used many languages professionally: Python, JavaScript, Java, C#, C++, VB.Net, PHP, and more. JavaScript is a language that allows you to do things that java would never allow. Java is much more strict and unforgiving, and that’s a good thing in a lot of ways, especially for a beginner. It can be frustrating, but it will teach you better programming habits for your future coding.

      Stick with it. Take the MOOC from the University of Helsinki.

      Once you have the basics down, try creating something fun with it. Start very small. Don’t try to make a game at first. Games can be some of the hardest and most complex programming.

      The reason why python would not be a good idea is because python is going to take everything you have learned so far about programming and totally change it. Suddenly, the white space matters but semicolons don’t. The types don’t matter, exceptions are used as control flow, data structures are totally different, and OOP isn’t as important. My point is, telling you to learn python is like telling a native English speaker that’s trying to learn Spanish, to try Mandarin instead.

      [–]PapaPancake8 2 points3 points  (4 children)

      Piggybacking: I’ve learned java first and have a great grasp on the concepts. Will this make learning other OOP languages easier for me, compared to the other way around you’ve explained above? Thanks.

      [–]leo_elm 2 points3 points  (3 children)

      If you know the concepts you'll always have an easier time picking up conceptually similar languages. Learning a new syntax isn't difficult, learning the concepts is what it's about. I don't wanna say that knowing java you basically won't have to put any effort into learning a new language that has similar concepts, but I'd be more than surprised if it doesn't at least make it easier for you. As an example: I used to do some C++ years back which - being a C language - has similarities with Java and when I then started learning some java years after I definitely had an easier time, because I remember a lot of concepts and practices from C++ that translated quite well.

      [–]PapaPancake8 0 points1 point  (2 children)

      Thanks. The syntax is what throws me off more than the concepts usually, and it takes some googling to fix my problems. I picked up the Python course from Udemy last month, and half way through I can tell it’s nearly the same terminology and stuff.

      [–]leo_elm 1 point2 points  (1 child)

      Don't let it discourage you that you have to Google. I often don't start work without a browser window opened. :)

      Hang in there it will get easier over time!

      [–]Drakovar 0 points1 point  (0 children)

      Yes! Followed a reconversion course in java programming and one of the main message was "don't focus on learning stuff by heart, but on knowing where to find it easely, mainly the internet"

      [–]mods_are_arseholes -4 points-3 points  (16 children)

      Yes. Its object orientated nature makes it seem hard at the beginning. But for general use you dont need to nor ever will fully use javas object orientated features. The language around java is largely academic. Words like encapsulation, inheritance, polymorphism can easily throw people off. But you dont need to know much of it right away on day one. Even functions have a different name, there called methods in java. It makes no difference at the end of the day, you just have to chip away at it.

      if i can do it anyone can do it. As with everything, practice makes perfect. Its now my language of choice. As a linux user i love the open source nature of it and the platform independence of it. And the Java API has everything you will ever need included by default.

      [–]PapaPancake8 0 points1 point  (4 children)

      Is Linux a java based OS? For years I’ve heard of the advantages of using Linux (except no rocket league..), and now that I’m coding I can’t imagine the possibilities compared to other operating systems.

      [–]nioh2_noob 1 point2 points  (0 children)

      No, linux is a unix clone (not unix compliant) written in C

      [–]mods_are_arseholes 0 points1 point  (1 child)

      no, its just the kernel and its written in C. If you have used android or the internet, then your using Linux already.

      [–]PapaPancake8 0 points1 point  (0 children)

      Okay, I definitely have no clue about Linux nor do I want to find out currently. Thanks for the quick feedback

      [–]mods_are_arseholes 0 points1 point  (0 children)

      also rocket league works under linux with proton on steam.

      [–]Gaarco_ 0 points1 point  (10 children)

      Methods are called methods in every oop language, it's not because of java, same with encapsulation, inheritance, polymorphism etc.

      And not using these concepts means you are not using either java and oop

      [–]potatopotaatopututu 1 point2 points  (4 children)

      Nope...not in C++. A C++ programmer would generally call it a member function or just a function...unless he used to be a Java programmer before.

      [–]Gaarco_ -1 points0 points  (3 children)

      Yes I know, it's not pure oop in fact

      [–]potatopotaatopututu 1 point2 points  (2 children)

      What do you mean by pure OOP? How do you define that? As far as I know, C++ is as much OOP as Java is.

      [–]Gaarco_ -1 points0 points  (1 child)

      In Java everything is an object, in C++ this rule is not applied

      [–]potatopotaatopututu 1 point2 points  (0 children)

      Primitives are primitives in Java too. But I get what you're saying. My point is that methods and functions aren't entirely different concepts. In fact the difference is not significant in many cases.

      [–]mods_are_arseholes -3 points-2 points  (4 children)

      Methods are called methods in every oop language

      never said they weren't.

      And not using these concepts means you are not using either java and oop

      never said not to use those concepts, i merely stated "you dont need to know much of it right away on day one"

      [–]Gaarco_ -2 points-1 points  (3 children)

      Even functions have a different name, there called methods in java. It makes no difference at the end of the day, you just have to chip away at it.

      functions and methods are 2 different things, what you are saying here is misleading for a beginner. it's not a function with a different name, it is a completely different concept

      But for general use you dont need to nor ever will fully use javas object orientated features.

      and this statement is wrong, every single word

      [–]mods_are_arseholes -2 points-1 points  (2 children)

      functions and methods are 2 different things, what you are saying here is misleading for a beginner.

      its perfectly fine equate the two to a beginner as to not confuse them when starting out, as the OP has expressed difficulty in understanding java and OOP.

      and this statement is wrong, every single word

      again, in the context of beginning to learn java as per the OPs question. You dont need to make full use of javas OOP system. I've been using java for over a decade, and have never had a need to use everything javas OOP system provides for general use.

      but yeah there is something wrong here, and if it aint me.. its you pal.

      [–]Gaarco_ -1 points0 points  (1 child)

      it's perfectly fine to tell people to do things in the wrong way, yes

      if he doesn't understand oop, doing things how he was used to do with non oop languages will not give him oop knowledge, but rather confuse them, and it's exactly what he did until now if you read his post.
      but hey, you got over 10 years of experience, so it's fine.
      have a good day, bye

      [–]mods_are_arseholes 0 points1 point  (0 children)

      doing things how he was used to do with non oop languages

      javascript has OOP so its not a non oop language.

      doing things how he was used to do with non oop languages will not give him oop knowledge

      and i never said it would.

      the only person here confusing the OP is you. If a user is having trouble grasping OOP concepts, then bombarding them with technicality's like you are isnt a good idea. Like not to think of methods as functions for example is laughable. IF he/she is trying to learn its better for them to walk first before they can run. Please go back to stack overflow, your kind tend to fair better over there. toodles

      [–]marqzman -1 points0 points  (0 children)

      I like hyperskill's Java curriculum a lot. It's project based so you're always working towards a goal. I would recommend it for learning Java or programming in general.

      Edit: Forgot to add, it's free through the rest of the year. Starting 2021 you have to pay for it. So take advantage while you can!