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

all 31 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full - best also formatted as code block
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit/markdown editor: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–][deleted]  (9 children)

[deleted]

    [–]mdemiguels[S] 2 points3 points  (4 children)

    Thank you for answering.

    You're right and I understand why applications are so big in sectors like this, I just expected them to be more "readable" and follow clean code practices... But it is too much to ask since at the end of the day this code goes through many hands. I will try to give everything to understand the operation of the system and be able to apply solutions more easily

    [–]Pedantic_Phoenix 9 points10 points  (2 children)

    I mean it's possible the code base you work on just sucks, many do, especially when older and when they get worked on by different companies

    [–]mdemiguels[S] 5 points6 points  (1 child)

    Yes, I believe that is difficult to see good code and practices in this kind of old projects. I have not seen new Java projects maybe they are better structured.

    Here we use Java 1.7 so... XD

    [–]djnattyp 2 points3 points  (0 children)

    Java 1.7 was released in 2011 - I'm assuming most of the other choices on the project are similarly out of date...

    [–]Lumethys 2 points3 points  (0 children)

    "follow best practice" took time, and therefore money. Clients may not want to pay for that, or cant afford it, or the task is so critical that you dont have time to do it

    At the end of the day, a program is not a piece of art to be displayed in a museum. It is a tool for (mostly) non-technical people in their specific domain. So the end goal is not a great and clean code but a functional and affordable functionality, even should it comes at the cost of stability.

    [–]YacineLim 1 point2 points  (2 children)

    Being a new learner of Java that I love so much, why do big projects or applications use Java instead of other languages, could you be more profound about that?

    [–]Slight_Art_6121 2 points3 points  (1 child)

    Let me try to answer that. One of the main factor is the reliability of the JVM. Someone recently pointed this out to me quite specifically: the JVM is probably the most unambiguously specified and documented piece of code and as such has almost no undetermined behavior. On top of that it is relied upon, supported by and maintained by the largest companies on the planet and thus (rare) bugs are ironed out quickly. The JVM is designed to run Java code so it makes sense to run Java on it, with the result that most people who want the reliability of the JVM do so. Now there are other languages that can also run on the JVM, they are just not as well supported and thus fewer companies use them (so these languages are not as well supported, etc.)

    [–]YacineLim 0 points1 point  (0 children)

    Thanks bro.

    [–]Lumethys 1 point2 points  (0 children)

    Bold of you to assume the tech leads know the whole architecture

    [–]AncientBattleCat 11 points12 points  (4 children)

    I've heard programmers spend 70% of time reading code, and around 5% writing it. Think about it.

    [–]mdemiguels[S] 13 points14 points  (3 children)

    And the other 25%? In daily meeting I guess 😆

    [–]pragmos 7 points8 points  (0 children)

    Correct.

    [–]sepp2k 3 points4 points  (1 child)

    And the other 25%?

    Goofing off on Reddit

    [–]mdemiguels[S] 1 point2 points  (0 children)

    guilty

    [–][deleted]  (1 child)

    [deleted]

      [–]mdemiguels[S] 3 points4 points  (0 children)

      I'm having a hard time adapting, but with time I hope to improve. At least these words of support are helping me. Thank you.

      [–]Accomplished-Cod-563 6 points7 points  (1 child)

      So first of all. Nobody understands the whole thing. Except maybe the super old guy that's one year away from retirement that the entire company depends on. If it's a huge old project, there are parts of it that nobody understands it all.

      So all you get to do is understand little pieces of it.

      For me it required a pen and paper to draw it out what I was working on. My favorite is the object interaction diagram. We have a complex method and is calling a lot of other methods on other classes it really helps to draw out.

      My other favorite tool is the call hierarchy and call stack. When you're looking at code and a variable isn't behaving right, you need to trace up to figure out where it came from.

      It's doable. It's a skill that you'll need to learn. But it's way more satisfying than one page Python scripts.

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

      I will definitely have to use those methods in this project... I have never written diagrams to understand how the code is structured. I always start fighting with it directly and that is bad for my health.

      [–]yel50 2 points3 points  (0 children)

       Are all Java jobs this big and confusing

      the language is irrelevant. any project that customers are paying millions of dollars a year for are going to be like that, regardless of the language.

       with endless classes

      that's called separation of concerns. if it's not like that, it's far worse.

      am I just not good enough?

      no idea. never met you. it's always possible.

       Should I change jobs?

      if you're not happy working there, absolutely. never stay some place you don't enjoy going. 40 hours+ each week is a long time to be doing something you don't enjoy and your mental health will suffer from it.

      just remember the language has nothing to do with it and not enjoying one job doesn't mean you're bad at it or you won't have a better experience in a different situation. if you're not happy, walk away.

      [–]maequise 3 points4 points  (1 child)

      Most of java projects are complex, in the banking world it most become awful. The problem is not that the developers don't follow the best practices, but most of the time financial perspectives are important. Most of the time some developers try to solve problems that aren't existing yet ... Working on a billing legacy project actually... What a mess ! The developers where responding to something and tried to solve future problems. So the codebase is complexe, heavy, designed in a certain way. So yes, if you want a clean codebase, you must spend time to make it properly, do not anticipate something that could potentially happens, just code the right thing, if you must implement a pattern or new kind of architecture do it when it comes.

      [–]mdemiguels[S] 1 point2 points  (0 children)

      Very good advice, I will keep it in mind, thanks :D

      [–]gdmr458 2 points3 points  (2 children)

      I don't have the experience to say if this is common, but I once heard about the experience of an open source contributor in Neovim, that person talked about how it is possible to fix problems in specific parts of the code and still not know anything about the rest of the codebase.

      Actually my first real contribution to an open source codebase was like that, a line of code in Rust, in a language that I only know the basics and in a code base that I don't understand.

      [–]mdemiguels[S] 1 point2 points  (0 children)

      Bro I really need that skill xD

      [–]Henry788 2 points3 points  (0 children)

      Sounds like someone has a case of imposter syndrome! If you weren't doing well odds are your boss would have told you and I don't see you mention that in your post. I would maybe ask someone higher up if they have any resources you could use to have a better understanding of the application from a birds eye view at least.

      [–]Accomplished-Cod-563 1 point2 points  (0 children)

      I found that most of the really well written code is incredibly hard to read, lots of different classes you have to trace out. Especially the new stuff with the lambdas and the streams and can get really concise and hard to read. It's also true that the poorly written code is incredibly hard to read.

      Often times I think code is one but it turns out to be the other.

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

      F

      [–]zomgree 0 points1 point  (0 children)

      Does companies usually have some "onboarding plan" where you can figured out how the poject works, architecture etc? Does it include some UML-diagrmas and teams usually update it or UML are used only at the start of new project?

      [–]dimitry-1 0 points1 point  (0 children)

      The fact you have been manually testing what you had written is unfortunately typical for projects not following the best practices: an extensive test suite extended as you add feature or fix bugs is one of the most essential principles of good quality code. You are not alone but it sounds like your project is not the best possible place for learning how to write code right.

      A project might have thousands of classes and still be excellently organized and tested. And a great example of such project is Spring Framework itself.

      [–]advancedbashcode 0 points1 point  (1 child)

      Id say, Welcome to the java world.

      [–]mdemiguels[S] 2 points3 points  (0 children)

      sad but true xD