Saturday, July 4, 2015

Things I wish someone had told me.

If you're new to Java or programming in general, here are a few things that I wish someone had told me before I figured it out the hard way:

Databases are server software. If you're making a desktop application, do mot use databases to store information; write to a file if there's something you wish to save. Most databases don't hide inside your jar/application and get installed along with your application; you'll have to tell the user to download, install and set them up so that your application can access them. It's just not how you get your application running...

By all means, use JOOQ over Hibernate when you're getting it on with a ORM framework for your application, but make sure that you NEVER EVER EVER EVER forget that whatever folder you set JOOQ up with will be completely cleansed of any files not generated by JOOQ. This includes your own personalized record objects.

If you're using maven, the code in the POM where you'll be putting your  JOOQ generation file will look something like this:
<target>
    <packageName>com.company.projectname</packageName>
    <directory>src/main/java</directory>
</target>
 Make sure you change the package name to something like com.company.projectname.jooq or it will remove EVERYTHING in your root project folder.

If you accidentally set JOOQ up with your project root, you'll be glad to have read the next point:

Taking your time to interrupt yourself to commit your work to git may feel annoying and distracting; it's breaking your flow! But I promise you, IT'S WORTH IT! Whenever something's running as it should, tests come back OK and all of that, commit it! If all hell breaks loose because JOOQ was set to your root folder, you'll be thanking yourself! Not to mention the even more important thing; it will ease tracking your own code. Git offers you the amount of control to even commit single lines inside of your files. Use it! Because one day you'll be looking at your commit dumps and wonder when the heck you changed what that is now bugging your code apart. It will happen.

Learn to version your code from day one. Just do it.

Don't ignore project structures, thread safety, unit testing, Dependency Injection (DI), multi-layering your architecture, proper class separation, separation of concerns or  how to avoid side effects. As soon as you can, you need to star learning how to implement these things. They matter, they are important and you will thank yourself for learning it the right way straight away, not after you learned how to code the thickest pasta github has ever seen. You're a programmer, not a chef.

For now the last, but not least, advice I have for you:

The programming communities are very helpful and as long as you're aware of the fact that the help they give you is incredibly invaluable and something they give you for free. Demanding help is gonna get you about as much help as stabbing yourself in the middle of a forest will give you.

Happy coding everyone!

Friday, July 3, 2015

Fortunate one!

I haven't written much here lately as I've been pretty busy as I managed to land a job which I work at while I study. It eats all of my time but I'm very happy and fortunate. Working while I study is kinda exactly what I thought it would be; I'm learning so much! So many things I never thought existed! I'm not doing as much Java as I'd hoped but what does it matter when I get to learn and try so much other things that are so much fun!

I've only been a developer for 9 months and it's yielded so much for me and I feel incredibly lucky and happy. I earn money on my hobby! On what I love to do!

Now if you excuse me, I have lots to learn so enjoy this random quote:

Teach a man to google and he'll be developing for life. Teach a man to have you google it for him, and you'll be googling for him for the rest of his life.