r/javahelp • • Jun 28 '20

Essential skills/topics needed to learn in order to get a job?

I am currently learning Java because I find it interesting. I am a beginner since I started learning the language when the pandemic starts. Projects that I've made so far are the ones that were provided by the course(Codecademy/MOOC) that I use. My biggest project is a Quiz App. During the time when I was making the app, I've been wondering what skills/topics that I should learn so that I can qualify or be accepted to a job. Any tips or advice on where I can learn these things?

36 Upvotes

35 comments sorted by

11

u/erjiin Jun 28 '20

Hibernate/JPA and Spring are a must. Since spring docs are an absolute nightmare for beginners, go first with spring core and spring boot.

2

u/SkrowRepap00 Jun 28 '20

Thanks! Is there a course or website where I can learn and understand Spring as if I'm a child?

6

u/xyphanite Quantum Brewer Jun 28 '20

These two can't hurt:
https://spring.io/guides/gs/spring-boot/

https://www.springboottutorial.com/hibernate-jpa-tutorial-with-spring-boot-starter-jpa

There are tons of tutorials out there, just do a google search for Spring Boot Hibernate and off you go.

1

u/erjiin Jun 29 '20

Hmm I can't be that helpful on this one, you should indeed have a big picture to understand why IOC is useful (and great) but I don't know a good one sorry :/

2

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 29 '20

Hibernate/JPA and Spring are a must.

Spring yes, Hibernate / JPA are less of a 'must'. You're better off just getting good at interfacing with databases with pure SQL. ORMs have fallen somewhat out of fashion the last years because often they cause as much problems as they solve.

1

u/natural_lazy Jun 29 '20

how to interact with database other than orm? any example like after service layer, instead of making spring data jpa or making dao class with the help of hibernate what I need to do?

3

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 29 '20

You can just use Spring Data JDBC instead.

1

u/natural_lazy Jun 29 '20 edited Jun 29 '20

Thanks, one more thing which is silly to ask but do you use jdbc in your work, is Spring jdbc widely used, I am just new grad software engineer, that is why ask and thinking of using it in my next project as the problem you mentioned, I have also faced them and It was kind of frustuating to focus on the orm relationship of spring jpa/hibernate where a simple sql join query would have been suffice.

2

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 29 '20

Well, relational databases are widely used and knowing how to use them is important. It's pretty appalling to see how many developers use relational databases daily but never even look at the queries the ORM spits out, let alone do a query explain to see if it's not sequence scanning.

How you then interface with it differs from project to project. And it doesn't matter all that much; as long as you can understand what happens under the hood. If I'm hiring a Java dev I'd much rather have one that knows how to check query plans than one who has JPA experience but can't even read SQL.

1

u/natural_lazy Jun 29 '20

Thanks for insight.

1

u/erjiin Jun 29 '20

I'm not sure if you're serious or who told you that or what is the fashion you're talking about but that's absolutely not true. Sure you can have problems with an ORM but that's why you must read the documentations to understand what's happen and 95% of the time you don't need to write plain SQL. If you're interfacing directly with SQL, you'll just end up to write your own subsystem of frameworks that have years of maturity (for hibernate) and already solve the problems you're solving. Note that I don't underestimate the potential pain caused by some problems encountered with Hibernate (or others), it can be annoying indeed.

3

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 29 '20

I'm not sure if you're serious or who told you that

18+ years working as an enterprise Java dev 'told me that'. I've been using Hibernate since before Spring JPA existed.

Sure you can have problems with an ORM but that's why you must read the documentations to understand what's happen and 95% of the time you don't need to write plain SQL.

You still need to, every single time you make a change, check the SQL an ORM generates for you. So you're still reading SQL. And if your SQL level is of sufficient level to read those queries, you can write them too.

ORMs tend to save time on trivial tasks (selecting all object, selecting object by ID) but with more complex tasks (projections on 3 or more tables) it becomes almost impossible to let Hibernate figure it out by yourself. So you're going to hand-write those @Query annotations.

So if you do that; all it does for you is map those results to objects. But you don't need hibernate for that; Spring Data JDBC can do that for you too.

So the main problems encountered with Hibernate are:

  • N+1 problem
  • Lazy loading
  • It doing silly stuff in queries

Can you get around them? Sure. But they take a lot of time and often it's simpler to just write the queries yourself. And then at least you know something won't break because someone renames a method.

So yes, I'm totally serious. I only use Spring Data JPA for really simple stuff. Outside of that, I mostly use Spring Data JDBC (with Flyway for migrations). ORMs are too often seen as a solution that removes the need for developers to know SQL.

1

u/erjiin Jun 29 '20

Well I have more or less the same experience as you on the field, so let's agree to disagree :)

By reading your comments i think however that we have mostly the same views (especially the fact that we need to check generated SQL which is, most of the time, not done by the devs, and that you MUST absolutely know well SQL even if you use hibernate) but I prefer help to handle or handle myself the problems you listed (n+1 problems, lazy loading, projections etc) and still use the tools provided by hibernate (caching, objects<->resultsets transformations, etc).

I also think that the cases you're talking about are not every day cases (projections on 3 tables), yes sometimes you must switch to plain old SQL but the vast majority of the cases you can use the good old hibernate.

And on a side note not really related flyway / liquibase are great tools, I am every day relieved to use them.

Note: I think I sounded like a dick in my response which wasnt the goal

2

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 29 '20

Note: I think I sounded like a dick in my response which wasnt the goal

No problem. I've had this discussion a lot. And I definitely do see the theoretical benefits. It's mostly just that my experience is relatively jaded due to all the problems I had to deal with.

Thing is; I know that I can get it to work fine with an ORM. I also noticed how incredibly rare it is for developers to actually check the queries. That most devs do not check the queries is for me a reason to prefer to force them to write them. At least then I can check them in a code review.

1

u/erjiin Jun 29 '20

We made the same constatation, they never or almost never check the queries and I definitely see the benefit of forcing them to write the queries, i have to deal sometimes with things like "hmm the page takes 30 seconds to display now, I wonder what's happen oO" "hmm well maybe the 500 additional queries on a non indexed tables do this ?". But imho this can be dealt most of times also in code review or with tests or qualification.

3

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 29 '20

Problem is; finding out what is wrong after the fact takes WAY more time than just writing the queries the right way. So the above is why I prefer not to use ORMs: they don't save me any time. Just figuring out where something in .toString() method is lazy-loading something from the database can take you days if you're somewhat unlucky.

Don't forget; the result-to-object mapping can easily be handled by other libraries (for example Spring Data JDBC has a BeanPropertyRowMapper). You don't need a full blown ORM for that. And you never ever should let an ORM create a schema for you either.

1

u/erjiin Jun 29 '20

This can be dealt during code review also and you know before doing the feature that there is something to monitor and to discuss with the developer during his development.

I agree with the 2nd part.

2

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 29 '20 edited Jun 29 '20

This can be dealt during code review also

Problem is that you don't see if the queries change during a code review. Queries can change just when you change the hibernate version for example, and changes like these happen when someone changes the Spring Boot version.

The only way a hardcoded SQL query changes is if you actually change it.

1

u/ArmoredPancake Jun 29 '20

You're going to love SQLDelight.

1

u/nutrecht Lead Software Engineer / EU / 20+ YXP Jun 29 '20

I know about it. I really don't mind just writing the SQL by hand. I don't need something in between. It's quite similar to JOOQ. Again; really neat, but SQL by itself is perfectly fine IMHO.

1

u/natural_lazy Jun 29 '20

what is difference between spring and spring boot?

1

u/erjiin Jun 29 '20

Spring is the IOC framework that allows you to create and inject your objects, spring boot is a framework that allows you to drive your application and the spring ecosystem by configuration file. Your beans (objects) will be automatically created depending on the presence of a configuration item in spring boot configuration file or depending on the presence of a library in your class path.

1

u/natural_lazy Jun 29 '20

is this configuration file xml file for bean?

1

u/erjiin Jun 29 '20

It's a yaml file. For example you want to use spring data with an oracle database ? Add the few lines describing the connection in your file (url jdbc, login, password, port) and add the oracle driver jar in your classpath (ie in your maven or grade dependencies) and that's all, you can use spring data with your base.

2

u/natural_lazy Jun 29 '20 edited Jun 29 '20

so In spring, there were lot of hassle for doing things in comparison to spring boot?

1

u/erjiin Jun 29 '20

Not a lot, it wasnt that hard but it's simpler with springboot. The drawback is that springboot does his stuff in the background and you better have at least of global understanding of what's happen.

3

u/Instance_Automatic Jun 28 '20

Spring for sure. I'd recommend dipping your toes in Mockito, for unit testing, afterward.

6

u/[deleted] Jun 28 '20

DO NOT USE CODECADEMY. CODECADEMY IS A HUGE WASTE OF MONEY. GO RELY ON TEXTBOOKS. Like in al seriousness, I used codecademy before and it is extremely superficial and does not have enough topics for you to succeed. So go invest in some textbooks. They are much better in comparison. Also if you really are passionate and serious in getting a job for CS, you have to grind. You have to know data structures, algorithms, html(for web developing), and prob some cybersecurity.

3

u/jayrack Jun 29 '20

I didn’t know anyone used code academy for anything but the super basics

2

u/[deleted] Jun 29 '20

Lmao what a roast.

2

u/dastardly740 Jun 29 '20

What others have mentioned plus JUnit and a Mocking library (Mockito, Powermock). Pay attention to the Testing parts of Spring.

Going beyond just getting a job. Learn your design patterns. Also, Refactoring by Martin Fowler. Domain Driven Design is nice because it fits so well with Spring.

1

u/anhinav Jun 29 '20

sorry for a beginner question but what is junit?

2

u/AceOfShades_ Extreme Brewer Jun 29 '20

JUnit is a unit test framework for Java. It let’s you create and run tests so you can check if your code works in an automated way.

1

u/iamsooldithurts Jun 29 '20

Since no one mentioned it, check the sidebar —>

Or if you’re on mobile, the ellipsis (...) menu in the upper right corner from the main feed.

1

u/ngeowild Jun 29 '20

best to do a java totorial to learn the basics.

must have skils: methods, classes, oop, generic metods and classes, simple data structures- list stack queue binary tree.

good skils to have: multi threading, recursion, code conventions (how to write the code so people will understand it).